This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes JSP and the fly likes Printing path to JSP from tag file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Printing path to JSP from tag file" Watch "Printing path to JSP from tag file" New topic

Printing path to JSP from tag file

Ranadhir Nag
Ranch Hand

Joined: Mar 09, 2006
Posts: 138
How do we print out the path to a JSP from within a tag file hosted on the jSP.
In the tag file ,we do the following:
String getpath=pageContext.getRequest().getPathTrnaslated();

But this is printing out null.
How do we print out the Url of the including JSP?
Rashid Mayes
Ranch Hand

Joined: Jan 11, 2006
Posts: 160
Are you really looking for getRequestURI() or getRequestURL()? getPathTranslated() looks at extra information contained in the url

Rashid Mayes -
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63053

Inspect these two lines carefully:



[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
subject: Printing path to JSP from tag file
It's not a secret anymore!