java - Populating a Struts 2 select menu and redirecting action -
i have jsp file form. form contains select drop-down menu
<s:select label="make selection" headerkey="-1" headervalue="select option" list="stuff" name="books" />
now, populate select menu created java file that. created selectaction
populate menu , made form's action pointed selectaction
in .xml file adjusted contains action populating select redirect action deal 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 trying in xml first have selectaction (so select menu populates) redirect addsubmitaction take care of form input.
however, not working. dispatcher not found error. approach incorrect? redirectaction being misused here?
parameter action name case sensitive
<param name="actionname">addsubmitaction</param>
Comments
Post a Comment