Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Jsp Request Path in JSP

Related Tutorials


 
 

Share on Google+Share on Google+

Request Path in JSP

Advertisement
We are providing you an example which shows the request path. The HTTPServletRequest interface provides method getRequestURL().

Request Path in JSP

     

This section illustrates you how to get the request path in JSP.

We are providing you an example which shows the request path. The HTTPServletRequest interface provides method getRequestURL(). The getRequestURL() method provides the URL of the request.

Here is the code of requestPath.jsp

<html>
<head><title>show Request Path</title></head>
<h2>Show Path:</h2>
<b>URL = <%= request.getRequestURL() %></b><br>
<b>ServletPath= <%= request.getServletPath() %></b>
</html>

In the above example, the method getRequestURL() is called which will display the URL of the current JSP page.

Here is the output:

Download Source Code

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: August 5, 2008

Related Tutorials

Discuss: Request Path in JSP   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com