Home » struts2 » Redirect action to another Url

Redirect action to another Url

We want to redirect a action to another website or url.
for that syntax is used

type=”redirect” is used to redirect this action to specified url.
here url is a variable in action class with getter and setter methods.
We are getting url value from jsp page.to get url value in struts.xml we used ${url}.

First.jsp

Struts.xml

RedirectAction.java

Output

redirect action
redirect action

redirect result

Managed by MochaHost - Fast & Easy WordPress Hosting