No, but this is not the problem.  I discovered last night that the setter
and getter must match precisely- not only the name must correspond with the
property (obviously) but the object type of the property must be the same as
well. i.e.:

String getProperty()
setProperty( String str )

can't be like this:
String getProperty()
setProperty( Timestamp t )

This seems a little odd to me. Does anyone know if this is mandated by the
Servlet spec, or has WL just done something funky in their implementation?

Thanks,
Bob



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 08, 2001 5:11 PM
To: [EMAIL PROTECTED]
Subject: RE: Weblogic related question- javax.servlet.jsp.JspException:
No get ter method for property...



You're Bean class does not extend ActionForm..




 

                    [EMAIL PROTECTED]

                    elheim.com                        To:
[EMAIL PROTECTED]                                    
                                                      cc:

                    08/08/2001 03:56 PM               Subject:     RE:
Weblogic related question-                               
                    Please respond to
javax.servlet.jsp.JspException: No get ter method for property...         
                    struts-user

 

 






The Bean class does have a matching get method for the specified property.
This is why I don't understand why I am receiving this error...




-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 08, 2001 4:45 PM
To: [EMAIL PROTECTED]
Subject: Re: Weblogic related question- javax.servlet.jsp.JspException:
No get ter method for property...



RequestUtils is using introspection on your form bean class to match the
name you placed in your <html:text tag with a bean method name.  So, if you
had:

<html:text property="requestDate">

Your form bean should have:  String getRequestDate()
               and        void   setRequestDate(String)

Brian






                    [EMAIL PROTECTED]

                    elheim.com                        To:
[EMAIL PROTECTED]
                                                      cc:

                    08/08/2001 03:22 PM               Subject:     Weblogic
related question- javax.servlet.jsp.JspException:
                    Please respond to                 No get ter method for
property...
                    struts-user










I am moving a Struts-based application from WebLogic 5.1 to 6.1 and I am
encountering some strange errors. Has anyone else seen this behavior
before,
or know what might be causing it?  I have a Collection of beans I am trying
to iterate through using the Struts iterate tag (works fine with WL5.1) but
now I am getting an error that there is no getter method. I have verified
with the debugger that at runtime the Collection exists and it is populated
with the expected objects. I am not really sure what is going on... The
only
thing I can think of is that this method does not exactly conform to the
JavaBean spec- it does not set/get the same type of object. When doing a
set, you pass it a TimeStamp but for the get it returns a formatted String
(see below). However, the naming conventions are followed correctly. Is
this
a problem?


############ WL Exception #############
note: the bean called "theFermentation" is a FermSummaryBean (see below)

javax.servlet.jsp.JspException: No getter method for property requestDate
of
bean theFermentation
        at
org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:517)
        at
org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:179)
        at jsp_servlet._mainmenu._jspService(_mainmenu.java:385)
        at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java


:263)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java


:302)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java


:200)
        at
weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImp


l.java:190)
        at
org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.ja


va:1758)
        at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1595)
        at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java


:263)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java


:200)
        at
weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImp


l.java:190)
        at
org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.ja


va:1758)
        at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1595)
        at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java


:263)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java


:200)
        at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo


ntext.java:2390)
        at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java


:1959)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


############# Snipet from the JSP ################

        <jsp:useBean id="RecentRequests" scope="request"
class="java.util.ArrayList"/>
        .
        .
        .
        <logic:iterate id="theFermentation" name="RecentRequests">
        <tr class="smallText">
          <td><bean:write name="theFermentation"
property="requestName"/></td>
          <td><bean:write name="theFermentation"
property="requestType"/></td>
          <td><bean:write name="theFermentation" property
="requestBy"/></td>
          <td><bean:write name="theFermentation"
property="requestDate"/></td>
          <td><bean:write name="theFermentation" property="status"/></td>
          <td><a href="viewFermRequest.do?fermid=<bean:write
name="theFermentation" property="requestId"/>">
            View...</a> <logic:equal name="theFermentation"
property="editable" value="true">
            <a href="fermAdmin.do?fermid=<bean:write name="theFermentation"
property="requestId"/>">
            Edit...</a> </logic:equal> </td>
        </tr>
        </logic:iterate>


######### Contents of Bean class #############

package com.bipi.plims.entity;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;

/**
 * Value object that contains basic summary information about a
fermentation
request.
 * @author Robert Hayden
 * @version 1.0
 */
public class FermSummaryBean implements java.io.Serializable {
    public String getRequestName() { return requestName; }

    public void setRequestName( String requestName ) {
        this.requestName = requestName;
    }

    public String getRequestDate() {
        SimpleDateFormat df = new SimpleDateFormat( "MMM d yyyy" );
        return df.format( requestDate );
    }

    public void setRequestDate( Timestamp requestDate ) {
        this.requestDate = requestDate;
    }

    public String getRequestBy() { return requestBy; }

    public void setRequestBy( String requestBy ) { this.requestBy =
requestBy; }

    public Long getRequestId() { return requestId; }

    public void setRequestId( Long requestId ) { this.requestId =
requestId;
}

    public String getStatus() { return status; }

    public void setStatus( String status ) { this.status = status; }

    public String getRequestType() { return requestType; }

    public void setRequestType( String requestType ) {
        this.requestType = requestType;
    }

    public boolean isEditable() { return editable; }

    public void setEditable( boolean editable ) { this.editable = editable;
}

    private String requestName;
    private Timestamp requestDate;
    private String requestBy;
    private Long requestId;
    private String status;
    private String requestType;
    private boolean editable = false;
}









Reply via email to