Struts- two actions with same path in struts config
807605May 24 2007 — edited Jun 25 2007hai
I am having html:select tag with two options (View And Download) in a form.My form signature is like <html:form action="select">.I mapped two options(View,Download) with same action path.When i click view it doesn't forwards(remains idle) and no error is shown.But i click download it forwards to the appropriate page.If iam having two tags with same action path the second is only working.This problem doesn't comes when iam having one tag alone.
My code is here:
-----------Select.jsp----------------
<html:form action="Select">
<html:select property="id">
<html:option value="view">View</html:option>
<html:option value="download">Download</html:option>
</html:select>
</html:form>
--------------------------------------------
----------------Struts-config.xml------------
<form-beans>
<form-bean name="viewForm" type="ViewForm"/>
<form-bean name="download" type="DownloadForm"/>
</form-beans>
<action-mappings>
<action path="/Select"
name="viewForm"
type="ViewAction"
input="/Select.jsp">
<forward name="success" path="/Success.jsp"/>
</action>
<action path="/Select"
name="downloadForm"
type="DownloadAction"
input="/Select.jsp">
<forward name="success" path="/Welcome.jsp"/>
</action>
</action-mappings>
----------------------------------------------------------------------
Can i have action tag with same paths like this.If not please provide me a solution