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" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
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
> [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



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

Reply via email to