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}"
.....
.....
.....
.....
-
jsp:setproperty not working.(urgent) (4 messages)
- Posted by: Web Master
- Posted on: June 26 2001 02:24 EDT
Threaded Messages (4)
- jsp:setproperty not working.(urgent) by Aditya Anand on June 26 2001 14:42 EDT
- jsp:setproperty not working.(urgent) by Web Master on June 27 2001 03:24 EDT
-
jsp:setproperty not working.(urgent) by Aditya Anand on June 27 2001 01:17 EDT
- jsp:setproperty not working.(urgent) by sankar subramanian on June 28 2001 08:36 EDT
-
jsp:setproperty not working.(urgent) by Aditya Anand on June 27 2001 01:17 EDT
- jsp:setproperty not working.(urgent) by Web Master on June 27 2001 03:24 EDT
-
jsp:setproperty not working.(urgent)[ Go to top ]
- Posted by: Aditya Anand
- Posted on: June 26 2001 14:42 EDT
- in response to Web Master
the attribute name chosen in the bean is wrong... name the attribute myName instead of name! -
jsp:setproperty not working.(urgent)[ Go to top ]
- Posted by: Web Master
- Posted on: June 27 2001 03:24 EDT
- in response to Aditya Anand
I have but its still not working error..
-
jsp:setproperty not working.(urgent)[ Go to top ]
- Posted by: Aditya Anand
- Posted on: June 27 2001 13:17 EDT
- in response to Web Master
I missed this but you'r method names are wrong as well...
getMyName and setMyName..... not capitalization of 'N' -
jsp:setproperty not working.(urgent)[ Go to top ]
- Posted by: sankar subramanian
- Posted on: June 28 2001 08:36 EDT
- in response to Aditya Anand
Import your bean in JSP by using <%@page import=bean name%>
sankar