struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "mech" <m...@rz.fh-augsburg.de>
Subject RE: Actions invoked by links have more flexibility than those driven by forms?
Date Thu, 02 Jan 2003 20:52:28 GMT
> 
> On the other hand, with html:form I don't seem to have the 
> same functionality. I don't see a way to refer to a parameter 
> or set of parameters in the html:form tag so that I can pass 
> through parameters that way. So I pretty much have to pass 
> through anything I want to send to an action invoked through 
> a form using the ActionForm that it gets when it is called.

Mmmhh... Strange question indeed... With <html:form method="GET"> you
could deliberately set that every form parameters are added to the
action url.
GET will URL encode the parameters from your form... So an <input
type="text" name="testfield"> will become ?testfield=value in your
URL... So really, why should you want to trigger (again) in the
<html:form> tag? Yoo can already if you use "GET".

The only thing is that <html:form> sets the method to "POST" by
default... So you usually won't "see" the form parameters in the URL. 
But for the form processing servlets that's transparent how the
parameters are transfered.
> 
> My question is: Why? Since the action for the form is written 
> into the HTML in much the same fashion as a link is written, 
> why can't you make reference to one or even multiple 
> parameters that you want to be written into that URL via the 
> same mechanisms that are available through html:link? Why not:
> 
> <html:form paramId="id" paramName="myBean" paramProperty="id" 
> action="/test">
> 
> Or am I missing something completely?

Try <html:form method="GET">... Then you will see "all" your form fields
encoded into URL parameters.
But except making links bookmarkable there's hardly any reason to use
GET, IHMO.

Michael


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message