Stripes

FormTag renders wrong action name.

Details

Description

When using clean url binding: @UrlBinding("/signin/{$event}/")

and <stripes:form action="/signin/authenticate" id="signin">.

FormTag renders: <form id="signin" action="/signin/" method="post">

There is no possibility of using events with stripes forms.

Activity

Hide
m.j.milicevic added a comment - 12/Sep/08 4:22 AM

Well, you don't,
action is set by your submit button(name attribute)

(or you can either use _eventName hidden field)

Show
m.j.milicevic added a comment - 12/Sep/08 4:22 AM Well, you don't, action is set by your submit button(name attribute) (or you can either use _eventName hidden field)
Hide
Krzysztof Szymanski added a comment - 12/Sep/08 5:22 AM

The problem is that I'm using action field when creating ajax call.
new Ajax.Request(form.action, {method:'post', parameters:params, ....
Button or _eventName usage will require changes in *.jsp and *.js

The other problem is that it worked fine in previous framework versions(FormTag rendered fine action names), so now it is not backward compatible.

It would be really useful if I could decide what action FormTag will render.

Show
Krzysztof Szymanski added a comment - 12/Sep/08 5:22 AM The problem is that I'm using action field when creating ajax call. new Ajax.Request(form.action, {method:'post', parameters:params, .... Button or _eventName usage will require changes in *.jsp and *.js The other problem is that it worked fine in previous framework versions(FormTag rendered fine action names), so now it is not backward compatible. It would be really useful if I could decide what action FormTag will render.
Hide
m.j.milicevic added a comment - 15/Sep/08 4:10 AM

hm, well, this has been discussed quite few times before, for example in this call:

http://www.stripesframework.org/jira/browse/STS-568
and this one:
http://www.stripesframework.org/jira/browse/STS-258

"Button or _eventName usage will require changes in *.jsp and *.js",

actually only to your jsp if your js code is ok; adding event attribute to your form is also changing your code...

Personally I don't have problem adding it, but there are probably some issues with current way of doing it (submit name) and adding it as attribute (one would need to check which one to use when, cause afaik you can have multiple buttons on a form)

Show
m.j.milicevic added a comment - 15/Sep/08 4:10 AM hm, well, this has been discussed quite few times before, for example in this call: http://www.stripesframework.org/jira/browse/STS-568 and this one: http://www.stripesframework.org/jira/browse/STS-258 "Button or _eventName usage will require changes in *.jsp and *.js", actually only to your jsp if your js code is ok; adding event attribute to your form is also changing your code... Personally I don't have problem adding it, but there are probably some issues with current way of doing it (submit name) and adding it as attribute (one would need to check which one to use when, cause afaik you can have multiple buttons on a form)
Hide
Ben Gunter added a comment - 23/Dec/08 9:32 AM

I agree that it seems like if you say action="/foo" then the form's action attribute should be whatever you set it to. This is pretty complicated to fix, and I don't want to run the risk of introducing any new issues in 1.5.1 because of it so I'm slating it for 1.6 for now.

Incidentally, this behavior dates back to a 03/25/06 when Tim first added the ability to append the event name to the path. It was not introduced with clean URLs.

Show
Ben Gunter added a comment - 23/Dec/08 9:32 AM I agree that it seems like if you say action="/foo" then the form's action attribute should be whatever you set it to. This is pretty complicated to fix, and I don't want to run the risk of introducing any new issues in 1.5.1 because of it so I'm slating it for 1.6 for now. Incidentally, this behavior dates back to a 03/25/06 when Tim first added the ability to append the event name to the path. It was not introduced with clean URLs.
Hide
Ben Gunter added a comment - 27/Feb/09 3:01 PM

Fixed. If the action= attribute of stripes:form is set instead of the beanclass= attribute then the exact value given will be used as the form's action.

Show
Ben Gunter added a comment - 27/Feb/09 3:01 PM Fixed. If the action= attribute of stripes:form is set instead of the beanclass= attribute then the exact value given will be used as the form's action.
Hide
Scott Archer added a comment - 27/Feb/09 4:27 PM

Here's a stacktrace I'm getting when I put the form path in there right now.

Show
Scott Archer added a comment - 27/Feb/09 4:27 PM Here's a stacktrace I'm getting when I put the form path in there right now.
Hide
Ben Gunter added a comment - 28/Feb/09 3:41 PM

Thanks, Scott. Here's my svn commit comment:

Fixed a NPE reported by Scott Archer for STS-606. Before, if the s:form attribute "action" was set but did not map to an ActionBean then the "action" value would be used as the ActionBean's URL binding, basically acting as a placeholder. My changes for STS-606 started using null instead of that placeholder, which caused problems in several spots. This update fixes that.

Show
Ben Gunter added a comment - 28/Feb/09 3:41 PM Thanks, Scott. Here's my svn commit comment: Fixed a NPE reported by Scott Archer for STS-606. Before, if the s:form attribute "action" was set but did not map to an ActionBean then the "action" value would be used as the ActionBean's URL binding, basically acting as a placeholder. My changes for STS-606 started using null instead of that placeholder, which caused problems in several spots. This update fixes that.

People

Vote (0)
Watch (1)

Dates

  • Created:
    12/Sep/08 4:16 AM
    Updated:
    04/Jan/11 2:48 PM
    Resolved:
    27/Feb/09 3:01 PM