Hii Jim,

Jim the Standing Bear wrote:
I am working on a JSF project, and one commandLink would refer to a
different project (a servlet) on the same tomcat server.  My question
is, how can I obtain the name of the server from a backing bean, so
that I can dynamically populate the commandLink no matter where the
war is deployed?  Because my JSF project would always have to use the
servlet that coexists on the same server, so hardcoding the servername
into the commandLink value is not an option for real deployment.

I know in servlet there is a way to do that, and even in JSP...  but
now I need to do that in JSF backing bean.  Please help. Thanks!
Calling
  FacesContext.getCurrentInstance().getExternalContext()
returns an ExternalContext object which gives you access to just about everything a Servlet has access to. Is this not sufficient for you?

Regards,

Simon

Reply via email to