?
Solved

Find the filename of the current, active JSP

Posted on 2005-04-22
5
Medium Priority
?
548 Views
Last Modified: 2008-03-17
Is there a name to get the name of the current JSP? I'm asking if there is a similar method like PHP's $_SERVER['PHP_SELF'] which will return the filename of the current php page.
0
Comment
Question by:varkon
  • 3
  • 2
5 Comments
 
LVL 29

Expert Comment

by:bloodredsun
ID: 13840926
<%=request.getServletPath()%>
0
 

Author Comment

by:varkon
ID: 13841256
bloodredsun that will give me the page, jsp or servlet but with some path information as well...is there a way (by using a method or some sort of manipulation) to get that without any slashes, dots or path info in general?
0
 
LVL 29

Accepted Solution

by:
bloodredsun earned 400 total points
ID: 13841309
<%
 String servPath = request.getServletPath() ;
 String[] servPathTokens = servPath.split("/") ;
 out.println(servPathTokens[servPathTokens.length-1]) ;
  %>
0
 

Author Comment

by:varkon
ID: 13841612
Excellent! Thank you very much!
0
 
LVL 29

Expert Comment

by:bloodredsun
ID: 13841621
No probs, glad to help :-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I came across an unsolved Outlook issue and here is my solution.
Last month Marc Laliberte, WatchGuard’s Senior Threat Analyst, contributed reviewed the three major email authentication anti-phishing technology standards: SPF, DKIM, and DMARC. Learn more in part 2 of the series originally posted in Cyber Defense …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question