You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mu Mike <mi...@hotmail.com> on 2004/04/11 11:26:11 UTC

what should I gave to the type attribute of a html:form

I have a html:form like this

<html:form name="myform" type="org.apache.struts.taglib.html.FormTag", it 
throw class cast excetion, what is the correct value of type?

you know ,I need to use name to refer to this form in javascript ..

Thanks&Regards
Mike

_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn  


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


Re: what should I gave to the type attribute of a html:form

Posted by su...@collab.net.
if you are using tomcat 4 or 5, its a problem specifying the form name in
attribute, coz tomcat uses referential integrity.

your struts-config.xml should have an entry for form

<form-bean name = "MyForm">
 <form-property = "formfieldname" type = "java.lang.String" />
</form-bean>

<action path = "/myactivity"
  name = "MyForm" >
  <forward name = "success" path = "/path/to/jsp or tile definition" />
</action>

---------------
your JSP
 <html:form action = "/myactivity.do" method = "get">
  .......
 </html:form>

---------------

your JS coding...
 document.forms[formIndex].formProperty

---------------
refer using form index in JS instead of name.

hope this if of some help.
Regards,
Sunny


> I have a html:form like this
>
> <html:form name="myform" type="org.apache.struts.taglib.html.FormTag",
> it  throw class cast excetion, what is the correct value of type?
>
> you know ,I need to use name to refer to this form in javascript ..
>
> Thanks&Regards
> Mike
>
> _________________________________________________________________
> ÓëÁª»úµÄÅóÓѽøÐн»Á÷£¬ÇëʹÓà MSN Messenger:
> http://messenger.msn.com/cn
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org





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