----- Original Message -----
From: Ryo Iwasaki <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 21st May 1999 10:54
Subject: Re: Inter-servlet communication using 2.1 API


> Dear folks:
>
>   I hava almonst same question.
>   I am using jsp1.0 (maybe same as JSDK 2.1).
>   I want to restrict to accesss some directory.
...
>   If I change to
>
>         String s = "/restricted"+req.getPathInfo();
>
> it makes infinite loop. How should I do?

Hi Ryo,

It seems to me that your Restrict server forwards a request
to itself (because of the mapping), instead of serving the HTML
file when it should, and therefore you get an infinite loop.
All what comes to my mind is that you should keep the
restricted files in another directory, not mapped to any
servlet and inaccessible by the web server directly,
and let your servlet load them from there.

I am newbie to servlets though, so maybe there is a way to
work around the mapping to avoid a "loopback" like the one
you described? Suggestions from other, more experienced
paricipants of this list are welcome :)

By the way, I solved my problem: it turned out that the
path I pass to a RequestDispatcher is relative to my webapp
directory ('jpl') and '/' stands just for it, not the web server's
document root as I supposed. I wonder how I can forward a request
from a servlet to a resource located up in the directory tree in that
case. Let's say I would like to display http://myservername/index.html
and my servlet lives under http://myservername/jpl/servlet/ServletName
Can anybody help or explain if that path mapping in RequestDispatcher
is specific to JSDK 2.1 only and "real" www servers would work
the way I imagine?

Thanks in advance -
JPL

http://www.kki.net.pl/jpl
Remote Java Development





--
Wyslano przez bezplatny serwer KKI

___________________________________________________________________________
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