WebSphere Portal Server - Get a service in a JSF portlet

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > August 2004 > Get a service in a JSF portlet





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Get a service in a JSF portlet

2004-08-13, 7:53 am

I need to get a service in a JSF portlet.

Normally you would use the following method:
...
PortletContext context = getPortletConfig().getContext();
MyService myService=(MyService)context.getService(com.mycompnay.MyService.class);
...

but in a JSF portlet you don't have the getPortletConfig() method.

I know that I can get hold of other things like the PortletRequest and so forth using the following:

...
PortletRequest request=(PortletRequest)(getFacesContext
().getExternalContext().getRequest());
...

but I can't find out how to get the portlet config or portlet context.

Anybody else know?

Justin Wood
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com