Hello i can't fetch the browser url.
I'm using spring controllers and Tiles.
instead of having http://www.myhost.it:8080/webapp/public/store/store.details.htm
i need the url for dispatching exceptions depending on url.
AFAIR, getRequestURL() from within the controller (not the view) returns the URL you're looking for.
eboix is correct. The request has been redirected to the JSP, so what you are seeing is the request relative to the JSP, not the original URL. What you should do, if you need the original URL in the JSP, is to call request.getRequestURL() in the controller and then put it as a value in the ModelAndView. For example:
Or more likely, put it in a Map and use that as the model passed to ModelAndView.
return new ModelAndView(getSuccessView(),"originalUrl",request.getRequestURL());
Actualy i needed the url inside the controller.
Jsp was just an easy way to see if it is possible to get Url.
Unfortunally jsp wasn't a useful quick test because is different from the controller.
From controller works nice.
Thank you guys!