Link to home
Start Free TrialLog in
Avatar of tunhien
tunhien

asked on

get file name

I have a jsp file . How can I get file's name by code ?
Avatar of Siva Prasanna Kumar
Siva Prasanna Kumar
Flag of India image

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.?
Avatar of tunhien
tunhien

ASKER

you want the same JSP's name in that JSP????  <---- yes
<%String x = request.getRequestURI();
 x.substring(x.lastIndexOf("/"),x.length());%>

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

just try this and get back.
ASKER CERTIFIED SOLUTION
Avatar of Siva Prasanna Kumar
Siva Prasanna Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial