[Webinar] Learn how to a build a cloud-first strategyRegister Now


get file name

Posted on 2006-04-17
Medium Priority
Last Modified: 2010-04-01
I have a jsp file . How can I get file's name by code ?
Question by:tunhien
  • 3
LVL 23

Expert Comment

by:Siva Prasanna Kumar
ID: 16475333
can you be clear
you want the same JSP's name in that JSP????
or you want that JSP name in some other java class.?

Author Comment

ID: 16475407
you want the same JSP's name in that JSP????  <---- yes
LVL 23

Expert Comment

by:Siva Prasanna Kumar
ID: 16475480
<%String x = request.getRequestURI();

use <%=x%> where ever you want to display.

just try this and get back.
LVL 23

Accepted Solution

Siva Prasanna Kumar earned 1000 total points
ID: 16475485
<%String x = request.getRequestURI();
x = x.substring(x.lastIndexOf("/"),x.length());%>

sorry use this code instead.

Featured Post

Technology Partners: 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

Moore’s Law has proven itself time and time again since it was first introduced. So what’s next? Will Moore’s law continue to remain relevant, or will new technology take over and bring us the next big advancement in computing?
LinkedIn blogging is great for networking, building up an audience, and expanding your influence as well. However, if you want to achieve these results, you need to work really hard to make your post worth liking and sharing. Here are 4 tips that ca…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

864 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