On Tue, 20 Nov 2001, Reto Badertscher wrote:

> Date: Tue, 20 Nov 2001 14:53:08 +0100
> From: Reto Badertscher <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Path in JSP
>
> Hello,
>
> when accessing a JSP thru a servlet (forward) the following path
> /image/logo.gif is valid. When calling a JSP directly i have to use
> ../image/logo.gif (image and jsp folder are on the same level).
> What can i do to use the same path definition?
> How can i prevent users from directly accessing a JSP?
>

You can do this by putting the JSP page itself inside the WEB-INF
directory.  This will make it impossible to access the page directly from
a browser, but still allow you to do a RequestDispatcher.forward() to it.

However, you might prefer a solution that makes your relative paths to
images work under all circumstances.  Check out the <base> directive in
the HTML specs.

> Thanks a lot for any tip
>
> Reto
>

Craig McClanahan


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to