my dog learned polymorphism*
The moose likes Portals and Portlets and the fly likes How to get servlet context name in a Portlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "How to get servlet context name in a Portlet" Watch "How to get servlet context name in a Portlet" New topic
Author

How to get servlet context name in a Portlet

Ignacio de Cordoba
Greenhorn

Joined: Jan 04, 2010
Posts: 13
Hi there,
After some time developing struts2 and JSF(2) I am entering the wonderful world of portlet programming (!!). I need to get the servlet context name in a group of portlets (I need to lookup some stateless session beans). I think there is still no CDI in the Portlet world (hope I am wrong, please tell me if so) and I must do traditional JNDI lookup.
As I am using EJB 3.1, my Session Beans portable names depend on the application name, so I need to getit. I haven't found any PortalContext.getServletContextName() or similar method, so any help will be appreciated (of course, I can read a parameter in web.xml, but I'd like to avoid it as the info I need is just the servlet context (application) name.

Thanks for any info or directions and, or course, sorry if I'm asking something toooo simple,
Ignacio
 
Don't get me started about those stupid light bulbs.
 
subject: How to get servlet context name in a Portlet