aspose file tools*
The moose likes Struts and the fly likes Change to 2.2.1 causes forms to not submit to specific method anymore Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Change to 2.2.1 causes forms to not submit to specific method anymore" Watch "Change to 2.2.1 causes forms to not submit to specific method anymore" New topic
Author

Change to 2.2.1 causes forms to not submit to specific method anymore

Sandy Noble
Greenhorn

Joined: Apr 30, 2009
Posts: 13
Hello, I've just updated an application from struts 2.0.6 to 2.2.1. The previous version used the dojo plugin extensively for date time pickers, but this time I have gone with the jQuery struts plugin and it's datepicker tag. There isn't much else I had to change, which was pleasing (and suspicious!)

I've come across a few niggles with warnings appearing in the server log, but they seem to be spurious and the system works. However, I have public methods in my action class called confirm(), complete(), a struts.xml that contains



and then a form like

my jsp:


This used to work fine, and would post the form to the same action that generated the page (in this case, DaytimeBooking.action), and calling the method called confirm().

Since I've updated struts, this same form now simply calls execute() instead of confirm(). I've tried a few different forms of submit:


is my standard unchanged version. This now calls execute() rather than confirm().


gives me an action not found error: There is no Action mapped for namespace /supervisor and action name DaytimeBooking!confirm. I do have <constant name="struts.enable.DynamicMethodInvocation" value="false" /> set in my xml too.



Actually works. But I don't want to hard-code the name of the action into the jsp because then I can't reuse it in other actions. This is also the reason for not having the action="DaytimeBooking" property in the <s:form ..> tag.

Has something anything changed in the way struts (or the taglib) handles these forms? Is there a better way of decoupling the jsp from the action rather than just omitting the action property?

Hope a smarter person than I can help!
Cheers
Sandy Noble
Greenhorn

Joined: Apr 30, 2009
Posts: 13
As an interesting development, this one:



gives me a java.lang.NoSuchMethodException: ( ... ).day.DaytimeBookingAction.!confirm()

looking for .!confirm() which is annoying.
Sandy Noble
Greenhorn

Joined: Apr 30, 2009
Posts: 13
2010-11-04 14:52:44,395 WARN - Could not create JarEntryRevision for [besjar:C%3A/Borland/BAS660/var/domains/base/configurations/... path to deployed *.war]!
java.util.zip.ZipException: The filename, directory name, or volume label syntax is incorrect

Is the "spurious" error that I'm getting in the logs, in case this is relevant.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Change to 2.2.1 causes forms to not submit to specific method anymore
 
Similar Threads
editing cells in table - not working
s:submit
Struts2 ajax theme - One form, two buttons.. two actions?
Struts2: No configuration found for the specified action
how to add 2 submit buttons of different form actions in same row in jsp page in struts2