Results 1 to 2 of 2

Thread: To get Filename for jsp Page on URl

  1. #1
    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?

  2. #2
    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

Similar Threads

  1. Convert String to filename
    By Maya Angelou in forum Software Development
    Replies: 5
    Last Post: 12-03-2010, 01:20 PM
  2. Excel filename too large
    By munkey79 in forum Windows Software
    Replies: 2
    Last Post: 09-07-2009, 04:24 PM
  3. PXE-E53: No boot filename received
    By Jisbomb in forum Windows XP Support
    Replies: 3
    Last Post: 14-04-2009, 07:43 AM
  4. max length filename
    By John A Grandy in forum Windows Server Help
    Replies: 6
    Last Post: 23-10-2008, 11:00 PM
  5. PXE-E53 No boot filename received
    By notagirrafe in forum Windows Server Help
    Replies: 3
    Last Post: 13-06-2008, 01:58 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,541,552.41068 seconds with 17 queries