struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Cranford" <chris.cranf...@tkdsoftware.com>
Subject Re: bean defines
Date Fri, 18 Jun 2004 19:47:31 GMT
And it may be important that I point out if I use:
    <bean:write name="<%=formBean%>" property="pageNumber"/>

The value does get outputted.  So it has to do with what Paul pointed out,
but I dont know how to solve it.
----- Original Message -----
From: "Chris Cranford" <chris.cranford@tkdsoftware.com>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Friday, June 18, 2004 3:45 PM
Subject: Re: bean defines


> It is as if the c-taglib is seeing the bean as a "string" and not as an
> ActionForm.  I can write:
>     <c:out value="${cfb}"/>
>
> And the output is value in formid.  What I'm trying to do is create a
> reference to an ActionForm in this JSP which has it's name passed in by
this
> page's container as a tiles attribute.
>
> ----- Original Message -----
> From: "Chris Cranford" <chris.cranford@tkdsoftware.com>
> To: "Struts Users Mailing List" <user@struts.apache.org>
> Sent: Friday, June 18, 2004 3:39 PM
> Subject: Re: bean defines
>
>
> > This is my class:
> >
> > public class PagedCheckboxForm extends ActionForm
> > {
> >     private long pageNumber;
> >     public long getPageNumber() { return this.pageNumber; }
> >     public void setPageNumber(long value) { this.pageNumber = value; }
> > }
> >
> > In the JSP
> > <bean:define id="formBean"><tiles:getAsString
> name="formid"/></bean:define>
> > <set var="cfb" scope="page"><%=formBean%></c:set>
> > The Page Number: <c:out value="${cfb.pageNumber}" />
> >
> > [ServletException in: /pages/cctest-body.jsp]
> > An error occured while evaluating custom action attribute "value" with
> value
> > "${cfb.pageNumber}":
> > Unable to find a value for "pageNumber" in object of class
> > "java.lang.String" using operator "." (null)
> >
> > HTH
> > Chris
> >
> > ----- Original Message -----
> > From: "Slattery, Tim - BLS" <Slattery.Tim@bls.gov>
> > To: "'Struts Users Mailing List'" <user@struts.apache.org>
> > Sent: Friday, June 18, 2004 3:33 PM
> > Subject: RE: bean defines
> >
> >
> > > > Ok, well if I do the following:
> > > >     <c:set var="cfb" value="${formBean}"/>
> > > >     <c:out value="${cfb}"/>
> > > >
> > > > The name of the form object is written out.  But if I want to
> > > > access a property on my form cfb, how would I output that
> > > > value?  If I write <c:out value="${cfb.pageNumber}"/>, I get
> > > > a servlet exception saying that it is unable to find
> > > > "pageNumber" in object of class "java.lang.String"
> > >
> > > Do you have a getter function for the pageNumber property? A method
> within
> > > the cfb object that looks like this:
> > >
> > > public String getPageNumber()
> > > {
> > >      return <somethingor0ther>;
> > > }
> > >
> > >
> > > --
> > > Tim Slattery
> > > Slattery_T@bls.gov
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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
> >
> >
>
>
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message