Reply To: Rewrite with Struts2

Splash Forums Rewrite Users Rewrite with Struts2 Reply To: Rewrite with Struts2

#25793

rahulsoni
Participant

Hi,

Is there also a way to rewrite the action URL that is being displyed in address bar.
Like:
http://localhost:8080/My_Struts2/radioUI.action can be displayed as:
http://localhost:8080/UI_Tags_01/radioUI

I’ve added following rule but didn’t work….
.addRule(Join.path("/radioUI.action/.*").to("/radioUI"))

Also my actions are invoking properly but the anchor links whom I’m rewriting aren’t.
Like:
<s:a href="/My_Struts2/abcd">ABCD</s:a>
To:
.addRule(Join.path("/abcd").to("/radioUI.jsp"))

Error Msg: HTTP Status 500 – The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag.

Plz let me know if there is any mistake in d way I’m using Rewrite with Struts-2.

Thanks