0

Thanks in advance for reading my question.

Question: I want original url in my strut's interceptor.

E.g:

From the browser, suppose i called... http://www.fakedomain.com/mycode/test.html

But this url is a url without rewrite...

Actually, Struts framework rewrite this into http://www.fakedomain.com/CreateMyCode.action

So, sceanario is...

When i fired the url from the browser...

  1. First, Strut's filter comes in a picture and it determines weather url rewrite is required or not. If it requires then
  2. Again same strut's filter is called modifdies into another url.
  3. Finally, strut's interceptor comes in a picture. But now when i tried to get url... i got modified url.

But i want the original url (which is not rewrite by struts...and which is actual called from the browser).

How can i get this?

My Try:

I have created one new filter... which comes before urlrewrite filter. And set some attribute like...

HttpServletRequest httpReq = (HttpServletRequest) request;
String uri = httpReq.getRequestURI();
httpReq.setAttribute("URLBeforeRewrite", uri);

But in interceptor when i tried to get the value like...

req.getAttribute("URLBeforeRewrite") 

i got modified url.

now, how can i solve this???

Manan Shah
  • 1,042
  • 2
  • 14
  • 26

0 Answers0