For ModelAction, I had made a change to the 1.0 Branch that fixes a peculiar bug that can occur when using struts and some versions of the ie browser.
The bug occurs when the enter key is pressed to submit a form. The problem is that under certain conditions and with some versions of ie when the enter key is pressed the form is submitted but the "button" that caused the submit will NOT be included as a name / value pair in the httpRequest that is sent to the web server. Thus, keel cannot determine which button was pressed and what command to run. In fact, keel was throwing an exception under these conditions. My fix made the code look for certain commands as "default" commands when a command isn't found in the ModelRequest and no model was specified as a parameter or passed in on the command line. Under these conditions, instead of failing, keel would look for commands with the following names in the following order --"DEFAULT", "SUBMIT" or "PROCEED" -- and if any of them exists on the page that was submitted, keel will execute the first command found. This "fix" is admittedly not perfect. It would be better to allow you to programmatically specify which command is the default (for example myCommand.setDefault(); ) but I implemented the check for hard-coded defaults as a simple and fast way of fixing what was a nasty bug... at least from a user's point of view. All of this is to say that, yes, ModelAction has been significantly refactored from the 1.0 Branch to the head and so I don't know how to merge my changes either... BUT if anyone would volunteer to add similar functionality to the HEAD (either my fix, or the setDefault fix), then we no longer need to merge my changes... and the bug would still be fixed. P.S.- For a thorough discussion of the issues with HTML forms and the enter key see the following link: http://ppewww.ph.gla.ac.uk/~flavell/www/formquestion.html which has an excellent discussion of the issue. -Phil On Fri, 2003-09-19 at 14:55, Santanu Dutt wrote: > Hi Steve, > First I did not get your querries on ModelAction. Could you please > send me the querries again? > > > I have not yet heard from Santanu on the changes to Strut's ModelAction, > > but I have figured out a piece of his intent. Currently, the Strut's > > client drops all files that are uploaded to it. Uploaded files are NOT > > available for Models to work with. > > This is wrong because the file data is available as byte[] to the > model. Look at FileUploadModel and the way it gets the file data and > writes it to the server directory. Also you can pass all other form > elements along with the file data to be processed in models. > Regards. > > > There are some other additions that were made to the Strut's ModelAction > > v1.0 that I would like to know the whys about as well, specificially the > > generation of two hidden fields, COMMAND & PARAMS. I don't think they > > are necessary with the enhancements for 2.0, but I want to be sure. > > Santanu? > > Philip? > COMMAND and PARAM are used to pass parameters pertaining to a > Command class when a particular button is clicked and the form is > submitted. > It is definitely required in 1.0. About 2.0 I have to check but there > must be a way to pass parameters for button clicks to figure out > important things such as the process model to execute and so forth. > Regards. > Santanu > > > Regards, > > Steve > > > > > > Sasvata (Shash) Chatterjee wrote: > > > Steve, > > > > > > You are probably right, some changes are required on the client side. > > > But ModelAction, as refactored in 2.0, is not the right place to do it. > > > In any case, what you had was the current execute() method, unchanged, > > > and an additional execute_1_0 (or something similar) that wasn't being > > > called. If the changes need to be made, they need to be sprinkled > > > case-by-case into StrutsClientConnector, AbstractWebappClientConnector, > > > AbstractClientConnector, etc. > > > > > > As I said before, a merge isn't likely to help in this case. Need to > > > identify the changes between the released 1.0 (2.0 was branched from > > > there) ModelAction and the latest version in Branch_1_0. Then, make > > > similar changes to the above classes. I doubt ModelAction will change > > > at all for this. > > > > > > As far as the 2.0 branch, we have ways yet to go. It is premature to > > > make the branch. But it is getting close to the release to warrant not > > > taking risks with the code. Maybe you can get the changes working and > > > tested on your local machine first? If need be, we can temporarily > > > branch clnt-struts for you to do the final collaboration with Santanu, > > > and when everything works we can merge back to HEAD? > > > > > > Shash > > > http://keelframework.org/documentation Keelgroup mailing list [EMAIL PROTECTED] http://lists.keelframework.com/listinfo.cgi/keelgroup-keelframework.com
