4 Replies Latest reply on Oct 29, 2012 7:27 AM by jhadipak

    JBoss 7 Directory Mapping

    mrober

      I'm very new to JBoss and I'm trying to set up virtual directories in JBoss AS 7. That is, I'd like to map a local static path such as

      C:/images

      to

      http://www.myurl.com/images

       

      I'm sure it's a simple thing, but I've been through the guides and I'm unable to find a solution. Any help is greatly appreciated.

        • 1. Re: JBoss 7 Directory Mapping
          mrober

          Hm...

           

          So, after days of digging, I've found solutions for all previous versions of JBoss, but none of them seem to work with AS 7. Has anyone had any success?

          • 2. Re: JBoss 7 Directory Mapping
            jhadipak

            Hi,

             

            I am stuck with a similar problem. I'm sure the mapping can be done...but am not sure where and how.

             

            Have you been able to find a solution?

             

            Dipak Jha

            • 3. Re: JBoss 7 Directory Mapping
              mrober

              Dipak,

               

              I found this: http://balusc.blogspot.com/2009/02/fileservlet-supporting-resume-and.html

               

              Though not exactly what I was hoping for, it does get the job done. Just use it to suit your needs and modify your web.xml file accordingly. You'll need something like this:

               

               

              <servlet>

                <display-name>FileServlet</display-name>

                <servlet-name>FileServlet</servlet-name>

                <servlet-class>com.PACKAGENAME.FileServlet</servlet-class>

                <init-param>

                 <param-name>basePath</param-name>

                 <param-value>C:/images/</param-value>

                </init-param>

              </servlet>

              <servlet-mapping>

                <servlet-name>FileServlet</servlet-name>

                <url-pattern>/images/*</url-pattern>

              </servlet-mapping>

               

               

              Hope that helps you or anyone else who stumbles across this thread with the same problem...

              • 4. Re: JBoss 7 Directory Mapping
                jhadipak

                Thanks a ton. That solves my problem. I've coded on similar lines and the thing seems to be working like a charm