tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ALEXANDROS KOTSIRAS" <ALEXANDRO...@prodigy.net>
Subject Re: Getting name of jsp file from within the jsp page
Date Tue, 08 Aug 2000 04:48:45 GMT
Maybe the request.getRequestURI() or request.getServletPath() can do that.
They will give you the entire path relative to the Context but you can
extract the filename only:

request.getRequestURI().substring(request.getRequestURI().lastIndexOf("/"))

..or a similar expression...
I might be wrong , i haven't tried that.
Alex.


----- Original Message -----
From: Doug Ahmann <dahmann@macromedia.com>
To: <tomcat-user@jakarta.apache.org>
Sent: Monday, August 07, 2000 3:32 PM
Subject: Getting name of jsp file from within the jsp page


> What is the quick and dirty way of getting the name of the jsp page from
> within the jsp page?
>
> For instance, inside "login.jsp" I would like to determine if I'm within
> "login.jsp".
>
> FWIW, I'm trying to create a toolbar that automatically highlights the
> "current" page. If there is a better way, other than hard-wiring it into
the
> page, let me know.
>
> Thanks,
> Doug
>
> ---------------------------------------------------
> Doug Ahmann
> Macromedia, Inc.
> (612) 840-9544
>


Mime
View raw message