try
<bean:define id="reg" name="formName" type="reg.form.RegForm"/>
where formName is the name u defined in the struts-config.xml

yanming lu wrote:

> Louis, I got the following error:
> An error occurred between lines: 46 and 47 in the jsp file:
> /WEB-INF/jsp/reg/RegForm.jsp
>
> Generated servlet error:
> C:\tomcat\work\localhost\test\WEB-INF\jsp\reg\RegForm$jsp.java:263: Method
> isReadOnly() not found in class java.lang.Object.
>               _jspx_th_html_text_1.setReadonly( reg.isReadOnly() );
>
> my code:
> <bean:define id="reg" name="reg.form.RegForm" />
>
> <html:html>
> ...
> <html:text property="name" size="40" maxlength="40"
> readonly="<%= reg.isReadOnly() %>" />
>
> What is wrong?
>
> >From: Louis Leung <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: Struts Users Mailing List <[EMAIL PROTECTED]>
> >Subject: Re: dynamicly set an attribute of tags
> >Date: Tue, 12 Mar 2002 16:14:31 -0500
> >
> >you can't do that, because your jsp page won't know where to find that
> >function.
> >
> >if, in your case, you want to call a form's function, then you have to
> >store the
> >form in some scope, then use <bean:define> to get the form bean in your
> >jsp, then
> >you can call the form's function freely
> >
> >yanming lu wrote:
> >
> > > I got error:
> > >
> > > Method isReadOnly() not found in class org.apache.jsp.RegForm$jsp.
> > >
> > > when I define isReadOnly() function the the form and used in the tag:
> > >
> > > <html:text ... readonly="<%=isReadOnly()%>" />
> > >
> > > Why?
> > >
> > > >From: Louis Leung <[EMAIL PROTECTED]>
> > > >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > > >To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > > >Subject: Re: dynamicly set an attribute of tags
> > > >Date: Tue, 12 Mar 2002 14:51:11 -0500
> > > >
> > > >you can define whether an attribute is a RTExpression (runtime
> >expression)
> > > >or
> > > >not.  for many of the struts tags, the attributes value can be of a
> > > >RTExpression.
> > > >
> > > >so for your case, you are certainly legal to do something like
> > > >
> > > ><html:text ... readonly="<%=giveMeTrueOrFalse()%>"/>
> > > >
> > > >or any scriplet you wanna put
> > > >
> > > >yanming lu wrote:
> > > >
> > > > > Is there any way in the struts to dynamically set an attribute?
> > > > >
> > > > > Example:
> > > > > <html:text ... readonly=true.../>
> > > > >
> > > > > For this tag, can we somehow to set readonly to true sometimes to
> >false
> > > > > based on certian conditions?
> > > > >
> > > > > _________________________________________________________________
> > > > > Join the world’s largest e-mail service with MSN Hotmail.
> > > > > http://www.hotmail.com
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > ><mailto:[EMAIL PROTECTED]>
> > > > > For additional commands, e-mail:
> > > ><mailto:[EMAIL PROTECTED]>
> > > >
> > > >
> > > >--
> > > >To unsubscribe, e-mail:
> > > ><mailto:[EMAIL PROTECTED]>
> > > >For additional commands, e-mail:
> > > ><mailto:[EMAIL PROTECTED]>
> > > >
> > >
> > > _________________________________________________________________
> > > Join the world’s largest e-mail service with MSN Hotmail.
> > > http://www.hotmail.com
> > >
> > > --
> > > To unsubscribe, e-mail:
> ><mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> ><mailto:[EMAIL PROTECTED]>
> >
> >
> >--
> >To unsubscribe, e-mail:
> ><mailto:[EMAIL PROTECTED]>
> >For additional commands, e-mail:
> ><mailto:[EMAIL PROTECTED]>
> >
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to