Michael,

You should think about it the other way. If you map a directory to a
servlet, you souldn't be able to directly access any document in that
directory, because although the URL seems to be the same, it's not :

without mapping :

http://www.mydomain.com/jgr/mydoc.html
                       ^   ^
                subdirectory
                           ^         ^
                             document

with mapping :

http://www.mydomain.com/jgr/mydoc.html
                       ^   ^
                   document
                           ^         ^
                            extra path

In the second case, the servlet is the document (dynamic) and what used to
be the document name is now the extra path info, which is not used by
default.

The strange thing is that you say you get different result. This can be
caused by a bug in Resin, or by some configuration differences that you did
not notice. What you should do (as always) is to test it against the
reference implementation (Tomcat).

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
Michael Weller
Envoy� : jeudi 12 juillet 2001 14:17
� : [EMAIL PROTECTED]
Objet : Re: url mapping


yes, that's really a good option and it propably would work the way i want
it, but i don't want no workaround, i want to know why resin behaves like
that and (most important) i want to know how i can change it!
the funny part about all this is that i have another webapplication on resin
2.0.1 with exactly the same entries in web.xml (the kind of entries is the
same, their values are different, i.e. mapped other servlets to other URIs),
and it does what i want it to do (i can request every file that exists)...
i didn't change anything in resin's configuration (except setting the
server's port to 80 instead of 8080, but if this is really causing the
problem, i'm going to sell my computer, drop off school and find myself an
island to life on ;-)

michael weller

----- Original Message -----
From: "Pierre-Yves Saumont" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 12, 2001 2:03 PM
Subject: Re: url mapping


> 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
>

___________________________________________________________________________
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