A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
EJB 3 in Action
this week in the
EJB and other Java EE Technologies
How can I get servlet url
Joined: Nov 19, 2008
Nov 19, 2008 01:50:00
I am trying to use request.getRequestURL().toString() to get the current page URL. instead of getting url appears in the browse (
) I am getting (
I am partly know why this happened, because I set to dispatcher to showAbc.jsp in the
class. but can anyone tell me how to get the first url that appears in the browser?
thanks in advance
SCJP 1.6 in 2010
SCWCD5 in 2011
Joined: May 11, 2005
Nov 19, 2008 12:40:00
would return the URL of the request submitted by the client. As I understand, the method would return the URL used for submitting the request.
I am getting (
Did you submit the request to showAbc.jsp?
If you want to know the URL of the page from which the request was sent, you can try reading the
header. By the way, are you trying to implement some security feature using this information? If not, why do you need this info for?
I agree. Here's the link:
subject: How can I get servlet url
doubt in forwarding
Can we change default method from GET to POST
Simple Servlet problem
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014