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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "s:submit" Watch "s:submit" New topic


ben oliver
Ranch Hand

Joined: Mar 28, 2006
Posts: 374
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: 374
I found out the problem. I used "protected" method by mistake. so it did not work. changed it to public and it worked. thanks.
subject: s:submit
Similar Threads
Struts 2 checkboxlist error - list key could not be resolved
problem running dojo.plugin in struts2.1.6
Need help in getting check box values
editing cells in table - not working
[Struts2] losing display only(prepopulated) values of the form if the validaiton fails