Or you might use your servlet to display the static file, using the extra
path information.

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.

With the addition of filters, this can be very powerfull.

Pierre-Yves

-----Message d'origine-----
De : A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]De la part de Mark
Galbreath
Envoy� : jeudi 12 juillet 2001 01:04
� : [EMAIL PROTECTED]
Objet : Re: url mapping


I haven't used Resin, but in general, when you map a directory to a servlet
instance in web.xml, the webserver/container is going to send every HTTP
request to the servlet to which that directory is mapped.  You need to put
the static HTML file into the webserver document root.

Cheers!
Mark

----- Original Message -----
From: "Michael Weller" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 11, 2001 1:54 PM
Subject: url mapping


> hi everybody,
>
> i have a servlet mapped to http://localhost/jgr and a static html file
> which should be displayed if i request
> http://localhost/jgr/aStaticFile.html. but if i request this static file
> all i receive is http://localhost/jgr i.e. the URI the servlet is mapped
> to. same thing happens if i put the static file in another subdirectory,
> e.g. http://localhost/jgr/aDir/aStaticFile.html, still
> http://localhost/jgr is shown. all i can receive are servlets that i
> mapped to an URL.
> i have another webapplication with almost the same web.xml (only other
> servlets are defined and mapped to other URIs), but here i CAN reach any
> static file.
> how is that possible?
>
> as servlet container i use caucho resin 2.0.1 and i already asked this
> question to the resin list at caucho.com but i didn't get any replies,
> now i hope to get some here.
>
> thanks in advance.
>
> Michael Weller
>
>
___________________________________________________________________________
> 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

___________________________________________________________________________
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