wood burning stoves*
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 Android Security Essentials Live Lessons 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
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: 60789
    
  65

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
 
Similar Threads
jsp can't find file
controlling printing in generated HTML page
Path of jsp files.
File path issues while reading an xsl file in java
Reading and writing to a JSP file using I/O