----- Original Message -----
From: "Marco Trevisan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 12, 2001 2:11 PM
Subject: Re: url mapping


> "Pierre-Yves Saumont" <[EMAIL PROTECTED]> wrote:
>
> > Or you might use your servlet to display the static file, using the
extra
> > path information.
> >
> Well, a web server like Apache isn't tuned just to accomplish this work?
> Serving static files isn't an unnecessary burden to a JVM ?
>
> > This technique can be use to map a directory to a servlet. You can then
> > access all document in this directory (and subdiretories) with their
> static
> > path, altough the document are served by the servlet. For example, when
a
> > user request :
> >
> > http://www.mydomain.com/jgr/mydoc.html
> >
> > he gets exactly what he asked for (document mydoc.html in directory
jgr),
> > but trough the servlet. The user never know he is accessing a servlet,
> > altough you can use it to parse the contain of the file and do whatever
> you
> > want.
> >
> How can such kind of servlet locate files indenpently from servlet
container
> and operating system ?
>
> Marco
>

since only files of the same webapplication would be sent by this servlet,
ServletContext.getResource() and ServletContext.getResourceAsStream() should
help (see Servlet Spec 2.3 at 3.4 for further information)...

-mw

>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to