Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 829725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:55:44+00:00 2026-05-15T03:55:44+00:00

How can I get request URL in JSP which is forwarded by Servlet? If

  • 0

How can I get request URL in JSP which is forwarded by Servlet?

If I run following code in JSP,

System.out.println("servlet path= " + request.getServletPath());
System.out.println("request URL= " + request.getRequestURL());
System.out.println("request URI= " + request.getRequestURI());

then I get the server side path to the JSP. But I want to get the URL as you can see in browser’s address bar. I can get it in the Servlet that forwards to the JSP, but I want to get it within the JSP.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T03:55:45+00:00Added an answer on May 15, 2026 at 3:55 am

    If you use RequestDispatcher.forward() to route the request from controller to the view, then request URI is exposed as a request attribute named javax.servlet.forward.request_uri. So, you can use

    request.getAttribute("javax.servlet.forward.request_uri")
    

    or

    ${requestScope['javax.servlet.forward.request_uri']}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I request for page, http://192.168.11.212:25/TespApp/pages/login.jsp with request.getContextPath(), we can get path /TespApp but i
Using the current request I can get the URL hostname with: HttpContext.Current.Request.Url.Host But -
Using cURL I can send a GET request with a body. Example: curl -i
I have a question about JSF and GET http request. How can I get
Each request in my web app can get one data access object instance (of
I have a view that can take several seconds to process a GET request
I'm trying to send a post request to Parse: https://parse.com/docs/rest#objects-creating . Can't get it
In Fiddler, I can pass in a request and get a response 500. Fine
Can someone explain why i cant get the desired delay between each request? They
look at these code: public static String get(String url, Properties parameters) throws MalformedURLException, IOException{

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.