struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Shneyderman" <a...@law.columbia.edu>
Subject RE: Newbie question about form name
Date Wed, 30 Jul 2003 12:08:25 GMT
Your action is configured with a form name.

Lookup action element in your struts-config.xml, 
Attribute of interest there is 'name' is the name of the form.
When you specify action in your html:form Struts connects the 
dots for you.

That form will be used to populate values of <html: elements 
On your JSP page.

HTH,
Alex.

> -----Original Message-----
> From: MaFai [mailto:zh-ma@hkbn.com.hk]
> Sent: Wednesday, July 30, 2003 8:01 AM
> To: struts-user@jakarta.apache.org
> Subject: Newbie question about form name
> 
> Hello, struts-user,
> 
> Sth make me confused while reading the type.jsp,one of examples in
Tomcat
> Strut struts-validator.war.
> 
> The following is the souce code.
> <html:form action="type">
>   <html:hidden property="action"/>
> 
> My question:
> why the form doesn't need the form name and form type.
> 
> For my limited skill,I would write this code:
> <html:form action="type3"
> 	name="myform"
> 	type="my.TypeForm2">
> 
> Do the form name has default name? But I think the type should
hardcode in
> the jsp page.
> 
> In strut-config.xml
> 
>     <!-- Type Action -->
>     <action    path="/type"
>                type="org.apache.struts.webapp.validator.TypeAction"
>                name="typeForm"
>                scope="request"
>                validate="true"
>                input="/type2.jsp">
>        <forward name="success"              path="/index.jsp"/>
>     </action>
> 
> The form type (TypeForm object) doesn't contain the form type,but the
> action form type is specified.
> 
> 
> 
> 
> Best regards.
> 
> MaFai
> zh-ma@hkbn.com.hk
> 2003-07-30



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


Mime
View raw message