Dale Newfield wrote:
Jeromy Evans wrote:
Shouldn't validation just be fixed?

What you really want to say in the s:submit tag is "run this action instead" what we're currently saying is "run this method instead". Because of this, you're getting different validation than you want because changing the method doesn't change the action selection.

This isn't a validation problem, it's a problem in the ActionMapper.

Exactly. It's a fundamental feature of webwork that actions and methods can be specified via request parameters. That was augmented in the DefaultActionMapper to allow wildcards to specify the action and methods. Over time various implementations have become out-of-sync, including XML Validation and every ajax tag. The DefaultActionMapper has been crammed full of inconsistent options and somehow we all get by because we know what does or doesn't work. It's alarming.

There's numerous unresolved JIRA issues relating to this.



The current s:submit implementation is also causing difficulty in the code base because it's been recognized as a possible security issue when used with URL-based authorization checking, and while a solution has been worked on, fully realizing it would require a change to the struts.xml spec to add allowable alternate method white-lists to the action mapping specification.


Agreed. I think over-time the form and submit tags have become out-of-sync with other aspects struts 2. My particular grievance is with the getMappingFromActionName(String) method that was added to the ActionMapper interface to support the form and submit tags. At the time the tags were written it was easy to calculate the URL to an action, but then wildcard support was added, then portlet support was added (and removed to a plugin), then complex namespace support was added in 2.1 (NamedVariablePatternMatcher) and these attributes don't always achieve the expected result. Use them within the REST context and they're even more meaningless. If I had my way, I'd deprecate the action and method attributes of these tags all-together. While there I'd split up the DefaultActionMapper so it doesn't try to be everything to everyone.



It would solve your validation problem and many more simultaneously. The only cost is that it makes the s:submit tag only work correctly if the client has javascript enabled.


I agree javascript on the submit tag works-around the problem, but it's just a band-aid for one part of the problem. And you're right, fixing XML validation is also just another greater effort band-aid. I'm tiring of applying band-aids, but am also concerned that some of the problems are bigger than any one of us.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to