I met with a puzzled question,I have two jsp files and one JavaBean file,I input
SerialNumber and IDCard in index.jsp and submit them into member.jsp file,then I set
SerialNumber and IDCard in JavaBean User.java through member.jsp.
My part of three files are follows:
index.jsp
...
<input type="text" name="SerialNumber" id="SerialNumber">
<input type="text" name="IDCard" id="IDCard">
member.jsp
...
<%@ page contentType="text/html" %>
<jsp:useBean id="user" class="Simis.User" scope="session" />
<jsp:setProperty name="user" property="SerialNumber" param="SerialNumber" />
<jsp:setProperty name="user" property="IDCard" param="IDCard" />
User.java
public class User {
String SerialNumber;
String IDCard;
public void setSerialNumber(String SerialNumber){
this.SerialNumber=SerialNumber;
}
public void setIDCard(String IDCard){
this.IDCard=IDCard;
}
...
}
when I run it,it raise follows error:
org.apache.jasper.JasperException: Cannot find any information on property
'SerialNumber' in a bean of type 'Simis.User'
I guess the first letter of "SerialNumber" should be lowercased,so I modified follows:
<jsp:setProperty name="user" property="serialNumber" param="SerialNumber" />
<jsp:setProperty name="user" property="IDCard" param="IDCard" />
It runs ok,what made my puzzled is why property="IDCard" need not lowercase?
Then I modified the first letter of "IDCard" into "iDCard",like follows:
<jsp:setProperty name="user" property="serialNumber" param="SerialNumber" />
<jsp:setProperty name="user" property="iDCard" param="IDCard" />
But it raise errors:
org.apache.jasper.JasperException: Cannot find any information on property 'iDCard' in
a bean of type 'Simis.User'
Why?
Any idea will be appreciated!
Edward
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant archives, FAQs and Forums on JSPs can be found at:
http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com