0 Replies Latest reply on Mar 27, 2009 3:04 PM by Tomasz Kramarczyk

    Virtual directory or another solution for my problem

    Tomasz Kramarczyk Newbie

      Hello.

      I'll describe my problem:

      I have few web applications:
      app1.war
      app2.war
      app3.war
      ...

      and now I have jsp pages inside those wars. I'm using apache-tiles, so in fact these jpss are templates and tiles, so they are the same in every application and I wan't to put them in one-global directory.

      Assume that I have following files in jsp directory:
      /jsp/page1.jsp
      /jsp/page2.jsp

      and I want to have them accessible in that way:

      localhost:8080/app1/page1.jsp
      localhost:8080/app2/page1.jsp
      localhost:8080/app3/page1.jsp

      I can't use virtual-static directories defined in server.xml because I need the same context as applications' context:

      <Context path="/app1" appBase="" docBase="/mnt/jsp" reloadable="true"/>
      <Context path="/app2" appBase="" docBase="/mnt/jsp" reloadable="true"/>
      <Context path="/app3" appBase="" docBase="/mnt/jsp" reloadable="true"/>

      so of course it doesn't work.

      In weblogic application server it is possible by defining virtual directories in weblogic.xml (which is placed in every application) and it works correctly.

      <virtual-directory-mapping>
      <local-path>/mnt/jsp</local-path>
      <url-pattern>*.jsp</url-pattern>
      </virtual-directory-mapping>




      How can I solve this problem? Mayby there are another technics and solutions instead of virtual directories. What terms should I use searching solution in google or documentation.