[jboss-user] [JBoss Seam] - Re: Layering / overloading resources approach

utiba_davidr do-not-reply at jboss.com
Tue Jun 26 20:53:12 EDT 2007


Hey,

  Thanks heaps for this. I believe overloading the ResourceResolver is the best option for layering XHTML files. With a method simmilar to:

    public URL resolveUrl(String resource) {
  |         String[] locations = {"", "/true/umarket", "/umarket"};
  | 
  |         URL url = null;
  |         for (String resourcePrefix: locations) {
  |             url = getClass().getClassLoader().getResource(resourcePrefix + resource);
  | 
  |             if (url != null)
  |                 break;
  |         }
  | 
  |         if (url == null) {
  |             url = super.resolveUrl(resource);   
  |         }
  |        
  |         return url;
  |     }
  | 
  |  ... elsewhere ... for the request ...
  | 
  |    resolveUrl("/agent/list_agents.wt");

This will traverse the class path, scanning under 3 prefixes. Of course I will make the prefixes configurable (perhaps inside the MANIFEST.MF of each XHTML jar file).

As for laying the pages/components xml files - I will have to wait until I have time to play around to see what works best there. Thanks for letting me know that worst case scenario I can overload the Pages component.

Cheers,

David

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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057928



More information about the jboss-user mailing list