Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find current jsp page in server code?

Status
Not open for further replies.

BPetro

Programmer
Oct 1, 2002
59
US
I know once the page is returned to the browser javascript can get at window.location - but how about while its still on the server side?? And for a .jsp page not a servlet class. Can I refer to the request or something like that to get at the page identity? IE: If every page has an include, can that include know which page is current?

Hope that is all clear, what I want to know, dynamically, is what the current URL is, including the file name (myPage.jsp), but I want to know it while we're still processing on the server side, not on the client side.

Thanks for any ideas!

 
OK, I guess I found it - so I'll leave an answer for others.

<%=request.getRequestURL()%>

THANKS!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top