aspose file tools*
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
JavaRanch » Java Forums » Java » JSP
Bookmark "Printing path to JSP from tag file" Watch "Printing path to JSP from tag file" New topic
Author

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();
pageContext.setAttribute("pathinfo",getpath);
%>
${getpath}


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
http://www.hostj2me.com/ - http://www.worlddeveloper.org/
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61224
    
  66

Inspect these two lines carefully:

pageContext.setAttribute("pathinfo",getpath);

${getpath}


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Printing path to JSP from tag file