[jboss-user] [JBoss Seam] - Re: Restrict

supernovasoftware.com do-not-reply at jboss.com
Wed Feb 14 18:48:14 EST 2007


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



More information about the jboss-user mailing list