java - How to get the real request URL in Struts with Tiles? -


when you're using tiles struts , do...

request.getrequesturl() 

...you url e.g. /web-inf/jsp/layout/newlayout.jsp instead of real url entered/clicked user, /context/action.do.

in newer struts versions, 1.3.x , after, can use solution mentioned on javaranch , real url using request attribute original_uri_key.

but how in struts 1.2.x?

i use this, works on spring:

<% out.println(request.getattribute("javax.servlet.forward.request_uri")); %> 

if need query string (contributed matchew):

<% out.println(request.getattribute("javax.servlet.forward.query_string")); %> 

Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -