Reputation: 51
I have a action with a url creation like this
if (this.sequence.equals("") ) {
action= "input";
} else {url = "/files/" + testHTML.getName();
action= "redirect";
}
return action;
in my struts.xml my action is declarated has
<interceptor-ref name="completeStack"/>
<interceptor-ref name="execAndWait">
<param name="delaySleepInterval">500</param>
</interceptor-ref>
<result name="wait">testwait.jsp</result>
<result name="input">test.jsp</result>
<result name="redirect" type="redirect">${url}</result>
</action>
When I launch the application, the url is created but there are no redirection to this new page but to the test.jsp page and I have the validation error message that appear. Anybody have some idea?
Upvotes: 2
Views: 2585
Reputation: 11055
Your original code example looks correct. Here are a few things to check:
getUrl()
method? The ${url}
part of the result relies on that method to get the url
property.Upvotes: 1
Reputation: 3080
if you are using validate method and if there is validation errors struts return result name="input". In your case put redirect in
<result name="input" type="redirect">${url}</result>
Upvotes: 0