JSP Logging, display file name

G

Ghost

I am trying to set up some logging from my JSP pages. I would like to
be able to send a message to the log file everytime someone tries to
access the JSP page.
Something like:

[Wed Jun 08 11:25:00 EDT 2005] GET index.jsp

Is there some sort of variable I can use to display the JSP file name
instead of manually typing in index.jsp like so:

<% System.out.println("[" + new java.util.Date().toString() + "] " +
"GET index.jsp"); %>

Thanks for any advice.
 
R

Rivky

This may work depending on you URI.

You can get the Request URI with request.getHeader("Request URI"); or
request.getRequestURI or something like that. But that will give the
whole path. You can also look into GtePathInfo or getPathTranslated/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,248
Latest member
MagdalenaB

Latest Threads

Top