I have a JSP file with form. That form contains a select drop-down menu
<s:select label="Make a selection" headerKey="-1" headerValue="Select Option" list="stuff" name="books" />
Now, to populate the select menu I created a java file to do that. I also created a SelectAction
that will populate the menu and made the form's action pointed to the SelectAction
In my .xml file I adjusted it so it contains action for populating Select then redirect to the action that will deal with the form
XML file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="example" namespace="/example" extends="struts-default">
<action name="SelectAction" class="example.SelectAction">
<result type="redirectAction">
<param name="ActionName">AddSubmitAction</param>
<param name="namespace">/example</param>
</result>
</action>
<action name="AddSubmitAction" class="example.AddSubmittAction">
<result type="chain">
<result>/example/addOrder.jsp</result>
</result>
</action>
</package>
</struts>
What I am trying to do in the xml is first have the SelectAction (so select menu populates) then redirect it to AddSubmitAction which will take care of the form input.
HOWEVER, this is not working. I get a dispatcher not found error. Is my approach incorrect? Is the redirectAction being misused here?