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

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

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -