jsp:setproperty not working.(urgent)

Discussions

Web tier: servlets, JSP, Web frameworks: jsp:setproperty not working.(urgent)

  1. jsp:setproperty not working.(urgent) (4 messages)

    Hello Everyone.

    Well i m made a JSP page in which i m using the <jsp:setproperty> tag associated with the <jsp:usebean> tag..but its not working..it gives me the error "CAN FIND THE METHOD FOR SETTING {1}"...though the <jsp:property> tag is working perfectly fine...i dont know what the problem is...the bean i have made is a simple class though i have'nt followed all the specs for the class to a bean..like introspection..that might be the problem..
    Can anyone comment on this...The Code for the JSP and the bean is as follows

    JSP PAGE:
    ---------

    <html>
    <body>
    <jsp:useBean id="bean1" scope="page" class="trainingapplication.mybean"/>
    Thanks for using the program.
    <jsp:setProperty name="bean1" property="Myname" value="Hello"/>
    <jsp:getProperty name="bean1" property="Myname"/>
    </body>
    </html>


    BEAN CODE:
    ----------

    public class mybean {
    private java.lang.String name = new String("TESTING");

    public mybean() {
    super();
    }

    public String getMyname() {
    return name;
    }

    public void setMyname(java.lang.String newname) {
    name = newname;
    }

    }

    THE ERROR THE JSP PAGE IS GIVING:
    ----------------------------------

    ERROR 500

    An error has occured while processing request:http://pklhed110s07:8993/rizwan/test1.jsp
    Message: "setProperty(bean1): Cant Find the method for setting {1}"

    Target Servlet: JSP 1.0 Processor StackTrace:
    ------------------------------------------------------------
    Root Error-1: "setProperty(bean1): Cant Find the method for setting {1}"

    com.ibm.servlet.engine.webapp.WebAppErrorReport: "setProperty(bean1): Cant Find the method for setting {1}"
     .....
     .....
     .....
     .....





  2. the attribute name chosen in the bean is wrong... name the attribute myName instead of name!
  3. I have but its still not working error..


  4. I missed this but you'r method names are wrong as well...
    getMyName and setMyName..... not capitalization of 'N'
  5. Import your bean in JSP by using <%@page import=bean name%>

    sankar