You cannot use a link to submit a form, unless you
call a javascript function from the link. The link
will only submit its parameters to the form bean.
Hope this helps,
Matt
--- Steve A Drake <[EMAIL PROTECTED]> wrote:
> Hello. I'm trying to use <html:link> to submit the
> contents of a form.
> The problem is that when I submit the form using
> <html:link>, the
> ActionForm bean is not populated. My form looks
> like:
>
>
> <html:form action="simpleQuery.do">
>
> ...
>
> <html:link forward="simpleQuery"
> paramId="offset"
> paramName="resultNavigator"
> paramProperty="startIndex" >
> {Stuff here}
> </html:link>
>
> ...
> </html:form>
>
> In struts-config.xml, I've defined a global forward
> mapping from
> "simpleQuery" to "/simpleQuery.do" . The parameter
> "offset" passes as a
> request parameter to the Action class okay.
>
> The only difference in the processing within Struts
> that I see is that,
> for a form submission with the "Submit" button,
> Struts sees a "POST"
> whereas for the <html:link> it sees a "GET"
> operation. For example,
>
> output when using <html:submit>:
>
> 2001-07-03 16:30:07 action: Processing a POST for
> /simpleQuery
> 2001-07-03 16:30:07 action: Looking for ActionForm
> bean under attribute
> 'simpleQueryForm'
> 2001-07-03 16:30:07 action: Creating new ActionForm
> instance of class
> 'edu.ucar.comet.struts.SimpleQueryForm'
> 2001-07-03 16:30:07 action: Storing instance under
> attribute
> 'simpleQueryForm' in scope 'request'
> 2001-07-03 16:30:07 action: Populating bean
> properties from this request
> 2001-07-03 16:30:07 action: Validating input form
> properties
> 2001-07-03 16:30:07 action: No errors detected,
> accepting input
> 2001-07-03 16:30:07 action: Looking for Action
> instance for class
> edu.ucar.comet.struts.SimpleQueryAction
>
>
> output when using <html:link>:
>
> 2001-07-03 16:30:24 action: Processing a GET for
> /simpleQuery
> 2001-07-03 16:30:24 action: Looking for ActionForm
> bean under attribute
> 'simpleQueryForm'
> 2001-07-03 16:30:24 action: Creating new ActionForm
> instance of class
> 'edu.ucar.comet.struts.SimpleQueryForm'
> 2001-07-03 16:30:24 action: Storing instance under
> attribute
> 'simpleQueryForm' in scope 'request'
> 2001-07-03 16:30:24 action: Populating bean
> properties from this request
> 2001-07-03 16:30:24 action: Validating input form
> properties
> 2001-07-03 16:30:24 action: No errors detected,
> accepting input
> 2001-07-03 16:30:24 action: Looking for Action
> instance for class
> edu.ucar.comet.struts.SimpleQueryAction
>
>
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/