To get Filename for jsp Page on URl
i am working on web based app.
When i run the project, my url shows filename.jsp which instead it shoul show just filename in url.
i have written servlet code for this, also done servlet mapping in web.xml file. but its not working.
Can anyone suggest code for this?
Re: To get Filename for jsp Page on URl
You can try the below code and check if its working for you or not:
Code:
•
<%
...getServletConfig().getServletContext().getRealPath(request.getServletPath()); //returns file name and path
...
%>
•
<%
...
application.getRealPath(request.getServletPath()); //returns file name and path
...
%>
•
<%
...
this.getClass().getName(); //returns the class name
...
%>
Also refer to some suggestions given in similar kind of threads here - http://forums.techarena.in/software-...nt/1182847.htm