Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Struts- two actions with same path in struts config

807605May 24 2007 — edited Jun 25 2007
hai
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 23 2007
Added on May 24 2007
4 comments
420 views