Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



To get Filename for jsp Page on URl

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 27-10-2011
p_g p_g is offline
Member
 
Join Date: Oct 2011
Posts: 1
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?

Reply With Quote
  #2  
Old 27-10-2011
Member
 
Join Date: Apr 2008
Posts: 1,948
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 - Is it possible to get the current URL in my JSP page
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "To get Filename for jsp Page on URl"
Thread Thread Starter Forum Replies Last Post
Convert String to filename Maya Angelou Software Development 5 12-03-2010 01:20 PM
Excel filename too large munkey79 Windows Software 2 09-07-2009 04:24 PM
PXE-E53: No boot filename received Jisbomb Windows XP Support 3 14-04-2009 07:43 AM
max length filename John A Grandy Windows Server Help 6 23-10-2008 11:00 PM
PXE-E53 No boot filename received notagirrafe Windows Server Help 3 13-06-2008 01:58 AM


All times are GMT +5.5. The time now is 03:27 PM.