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:39:16 GMT
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


Mime
View raw message