Charlie, I came up with something that satisfies my current needs, but 
I would hope there is a more fail-safe approach. Essentially I turn the 
generic browse switch for the default server on, add my virtual mapping, 
and then turn off browsing specific to my app's war.  It's like the 
reverse of what you do for security.  Imagine in your /etc/hosts.allow 
you permit all access, then one by one plug the holes...  Thanks for the 
followup, BenG.


   (a) 
$CONTAINER_DIR/servers/default/default-ear/default-war/WEB-INF/jrun-web.xml

       <virtual-mapping>
           <resource-path>/logs/*</resource-path>
           <system-path>$CONTAINER_DIR/logs</system-path>
       </virtual-mapping>

   (b) $CONTAINER_DIR/servers/samples/SERVER-INF/default-web.xml 

       <servlet>
          <servlet-name>FileServlet</servlet-name>
          <servlet-class>jrun.servlet.file.FileServlet</servlet-class>
          <init-param>
              <param-name>browseDirs</param-name>
              <param-value>true</param-value>
          </init-param> 
       </servlet>

   (c) In the web.xml for the .war's that you deploy add: 

    <servlet>
        <init-param>
          <param-name>browseDirs</param-name>
          <param-value>false</param-value>
        </init-param>
        <servlet-name>FileServlet</servlet-name>
        <servlet-class>jrun.servlet.file.FileServlet</servlet-class>
        <description>This servlet overrides FileServlet in 
SERVER-INF/default-web.xml.</description>
    </servlet>


charlie arehart wrote:

>That's a good question, and since no one has yet answered it, I'd like to
>follow it up with some related questions.
>
>First, does anyone indeed know if this is possible? Of course, this is a
>good place to remind folks that JRun 4 offers complete documentation of the
>xml descriptors such as jrun-web.xml, at
>[jrun_root]/docs/descriptordocs/index.html. But I did a search across all
>the files for "directory" or "browse" and didn't find anything about
>directory browsing.
>
>It also bears mentioning that if you're using IIS or Apache as your web
>server (and the JRun connector for that), then you'd make the directory
>browsing indicator there instead, right?
>
>But this raises a question I've had and been unable to test (since I'm just
>using the built-in web server on this system): would this indication made in
>the jrun-web.xml for a virtual mapping even be honored by an external web
>server?
>
>And here's another simil
>ar question: if you setup a virtual mapping for a
>servlet in web.xml (rather than using the /servlet invoker), will that be
>honored by an external web server? Someone using an external web server told
>me that it does not.
>
>/charlie
>
>>-----Original Message-----
>>From: Ben Groeneveld [mailto:bgroeneveld@;ici-web.com]
>>Sent: Wednesday, November 06, 2002 5:44 PM
>>To: JRun-Talk
>>Subject: How To Browse Virtual Dirs In JRun4
>>
>>
>>How do I tell JRun4 to permit directory browsing in a specific
>>directory, like the following dir defined  in my jrun-web.xml file?
>>
>>
>>  <virtual-mapping>
>>    <resource-path>/logs/*</resource-path>
>>    <system-path>/usr/local/JRun4/logs</system-path>
>>  </virtual-mapping>
>>
>>Thanks, BenG.
>>
>>--
>>Ben Groeneveld
>>Information Concepts, Inc., 115 N.W. Oregon, Suite 30, Bend, OR 97701
>>Mailto:BGroeneveld@;ici-web.com, phone:541.388.3611, cell:208.520.6488
>>
>>
>>
>>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=8
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=8
Get the JRun Web Application Construction Kit - the only book written specifically for 
JRun developers.
http://www.amazon.com/exec/obidos/ASIN/0789726009/houseoffusion

Reply via email to