8 Replies Latest reply on Jun 10, 2009 2:01 AM by raj reddy

    Virtual Directory?

    Vlad Vujicic Newbie

      Hi,

      I am using JBoss to upload photos and present them back as a part of users' profiles. I did in WebLogic by defining virtual directory in weblogic.xml using the next:

      <virtual-directory-mapping>
      <local-path>C:\WebProjects\MeetSerbsWL</local-path>
      <url-pattern>images/*</url-pattern>
      </virtual-directory-mapping>

      Can I do the same in JBoss 3.2.5?

        • 1. Re: Virtual Directory?
          dani mach Newbie

          I'm facing the same problem, does anyone have a solution?

          • 2. Re: Virtual Directory?
            Anthony Whitford Newbie

            Gee, I have this issue too... Theoretically, I could use Apache as a front-end (but I'd like to avoid administration of yet another piece of server software), or we could write a servlet that serves files from a directory (kind of surprised this doesn't already exist). Or did you find a better solution?

            • 3. Re: Virtual Directory?
              namontemayor Newbie

              Did you guy have a solution to this? I have the same problem.

              Thanks.

              • 4. Re: Virtual Directory?
                Kindor Bazul Newbie

                Add a context to the host by modifying the server.xml of your server as explained below. I simply tried out the configuration for the standalone Tomcat and it worked. The difference may be that with Jboss, the path is relative to the root of the server instance. Enjoy !

                <Host name="localhost"
                 autoDeploy="false" deployOnStartup="false" deployXML="false"
                 configClass="org.jboss.web.tomcat.security.config.JBossContextConfig"
                 >
                
                 ......
                
                 <Valve className="org.jboss.web.tomcat.tc5.jca.CachedConnectionValve"
                 cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager"
                 transactionManagerObjectName="jboss:service=TransactionManager" />
                
                 ......
                 <!--
                 Create your 'images' directory at the root of your server instance (ex. default) then insert the following line. Restart your server, you can browse the context via http://yourserver:port/images.
                 -->
                 <Context path="/images" docBase="images" debug="0" reloadable="true"/>
                 </Host>


                • 5. Re: Virtual Directory?
                  Nathan Helder Newbie

                  I'm attempting to do roughly the same thing (specify a specific folder to be served by JBoss) under JBoss 4.2.0, using the "all" configuration (which I've renamed to "default") and am not having much luck.

                  I've added the the following context line to my server\default\deploy\jboss-web.deployer\server.xml file:

                  ...
                   <Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve"
                   cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager"
                   transactionManagerObjectName="jboss:service=TransactionManager" />
                  
                   <Context path="/test" docBase="test" debug="0" reloadable="true"/>
                   </Host>
                   </Engine>
                   </Service>
                  </Server>


                  After that, and with server stop/starts between each step, I've tried creating populated "test" folders in both
                  server\default\test
                  and
                  server\default\deploy\jboss-web.deployer\test
                  but in neither case was I able I access http://localhost:8080/test

                  I've also tried specifying full paths for the "docBase" tag, but that didn't do the trick either.

                  ...has anyone had this working within JBoss, rather than a stand-alone Tomcat install like kindor tested? If so, what did you do to get it to work?

                  Thanks in advance,

                  - Nathan

                  • 6. Re: Virtual Directory?
                    Michael Diamant Newbie

                    I've got virtual directories working in JBoss AS v4.2.2.GA. See my post in the following thread, http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115702.

                    Best,
                    Michael

                    • 7. Re: Virtual Directory?
                      Margot Media Newbie

                      virtual directories (in weblogic) is different than context path..

                      requestdispatcher forward to another jsp page in virtual directory will not work in jboss, unless you add symbolic link (because it is in a different context)

                      • 8. Re: Virtual Directory?
                        raj reddy Newbie

                        I have configured the things in server.xml and it is able to serve;

                        My problem with application is: My application places some dynamic data in the docBase like some .doc files; after application places such file, through apache webdav support I edit .doc file for modifications;


                        When I try to save the modified content , its not updating in the docBase location; instead it is creating a new .doc file in apache root folder;

                        Please help as I need to configure to host my application at client location.