Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Default Document for Directory with RequestDispatcher

Reply
Thread Tools

Default Document for Directory with RequestDispatcher

 
 
fritz-bayer@web.de
Guest
Posts: n/a
 
      08-17-2005
Hello,

I'm using the RequestDispatcher to forward to urls. When the url ends
as an directory path, such as "/help/programming/" or "/help/java" then
my servlet engine (tomcat 5.5) displays the contents of the directory.

What I would like to achieve is that tomcat looks for a default
document to return, when a directory is access instead of returning
it's contents. Does anybody know how to do this?

Fritz

 
Reply With Quote
 
 
 
 
Babu Kalakrishnan
Guest
Posts: n/a
 
      08-17-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
>
> I'm using the RequestDispatcher to forward to urls. When the url ends
> as an directory path, such as "/help/programming/" or "/help/java" then
> my servlet engine (tomcat 5.5) displays the contents of the directory.
>
> What I would like to achieve is that tomcat looks for a default
> document to return, when a directory is access instead of returning
> it's contents. Does anybody know how to do this?
>


Depends on which servlet the request would map to :

If the url prefix maps to any servlet context that is defined, the
web.xml deployment descriptor of the servlet is consulted for a
<welcome-file-list> element.

If not, the "default" servlet's web.xml file is used (which is
conf/web.xml in the tomcat installation directory).

You can also set the value of the init-param called "listings" to false
to avoid displaying a directory listing in case no file specified in the
welcome-file-list is found in the directory. (Never verified it for user
specified contexts - but it does work for the default servlet - i.e when
the request doesn't map to any servlet context found)

BK
 
Reply With Quote
 
 
 
 
Tor Iver Wilhelmsen
Guest
Posts: n/a
 
      08-18-2005
(E-Mail Removed) writes:

> What I would like to achieve is that tomcat looks for a default
> document to return, when a directory is access instead of returning
> it's contents. Does anybody know how to do this?


Look for the description of the <welcome-file-list> element of
web.xml.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[J2EE] RequestDispatcher.include problem John English Java 6 07-19-2005 07:54 AM
RequestDispatcher executing in wrong directory DiscoStu Java 1 07-20-2004 12:47 PM
RequestDispatcher.include() behavior Ryan Stewart Java 0 05-20-2004 03:57 AM
RequestDispatcher.forward() Taking 30 Seconds Each Will Handley Java 1 12-10-2003 11:52 AM
Multiple includes with RequestDispatcher Paul Vincent Craven Java 0 08-29-2003 03:53 PM



Advertisments