I also use the following in components.xml

  | <factory name="basePath"
  |     
value="#{facesContext.externalContext.request.scheme}://#{facesContext.externalContext.request.serverName}:#{facesContext.externalContext.request.serverPort}#{facesContext.externalContext.request.contextPath}/"/>
  | 

Note this is all one line the forum wrapped

and 

<base href="#{basePath}" />

So i can have the view files in different directories, but still resolve the 
images and css to the root of the webapp with out having to do 
../../images/myimage.jpg

I used to use something like this

  @Create
  |   public void setup() {
  |     request = (HttpServletRequest) 
facesContext.getExternalContext().getRequest();
  |   }    
  |   
  |   
  |   @Factory("basePath")
  |   public void loadBasePath()
  |   {
  |      basePath = request.getScheme() + "://" +
  |                 request.getServerName() + ":" + 
  |                 request.getServerPort() + request.getContextPath() + "/";
  |   }



View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4016752#4016752

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4016752
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to