File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes s:submit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "s:submit" Watch "s:submit" New topic


ben oliver
Ranch Hand

Joined: Mar 28, 2006
Posts: 375
I have a JSP form like

<s:form action="saveInfo" method="post" theme="simple">


<s:submit theme="simple" value="Save" action="saveInfo" name="submit"></s:submit>
<s:if ...>
<s:submit theme="simple" value="Delete" action="deleteInfo" name="delete"></s:submit>

So I have two submit type buttons here. One is for "Save" and the other is for "delete", each has a different action name. I have defined the action mapping in struts.xml file. What I found is -- when I click the "delete" button, the url shows "../saveInfo", which is weird (it is supposed to show ../deleteInfo). but, but the almost blank screen shows a message like


In strust.xml mapping I map "deleteInfo" to this class . So it seems it called that class, then why the URL shows "saveInfo" ? Plus, when I use debug, it doesn't reach the "DeleteInfo" class.

Is there anything wrong here ?

David Newton

Joined: Sep 29, 2008
Posts: 12617

Is there anything in the logs? What does the configuration look like?

Oh, and please UseCodeTags.
ben oliver
Ranch Hand

Joined: Mar 28, 2006
Posts: 375
I found out the problem. I used "protected" method by mistake. so it did not work. changed it to public and it worked. thanks.
I agree. Here's the link:
subject: s:submit
jQuery in Action, 3rd edition