5 Replies Latest reply on Mar 27, 2014 12:45 PM by hfluz

    Load image from outside the web context in JBoss AS 7

    hfluz

      I created a topic in primefaces forum to ask how to access an image out of the context relative path inside the project which is deployed in JBoss AS 7.1.

       

      kukeltje said I can solve my issue by a servlet filter. I researched about it and found out this thread in stack overflow.

       

      According to BalusC I can also do that in tomcat and glassfish by doing the following:

       

      Add a new <Context> to the servletcontainer with a docBase which points to the absolute disk file system location of the folder with those images. How to do that depends on the container used. In case of for example Tomcat, that'll be the following new entry in /conf/server.xml:<Context docBase="/path/to/images" path="/images" />

      In case of for example Glassfish, that'll be the following entry in glassfish-web.xml:

      <property name="alternatedocroot_1" value="from=/images/* dir=/path/to" />

      This way I would be able to reference an image through relative path /images which could be located anywhere in my filesystem.

       

      Is there a similar way to do that in JBoss AS 7?