Using int data type for member of Java Bean
Posted on 2006-04-29
I have problems using a member of data type int in Java Bean
Below are the relevant parts of my Java Bean class file, Student.class
private int Count;
public int getCount()
public void setCount(int Count)
this.Count = Count;
JSP file which uses Student bean:
The below jsp file is actioned when I submit a form as part of another jsp file
It is simply set up to print out the Count and FirstName properties of the Student Java bean
It does print out the FirstName that I supply in the form correctly, but no matter which number I supply in Count in the form, 0(zero) is always returned for Count.
It is as if the Java Bean is not handling property of type int!
Maybe there is something else I need to be doing using another data type other than int or qualifying this more or soemething - Any advice appreciated.
<jsp:useBean id="student" scope="page" class="ie.nci.student.Student" />
<jsp:setProperty name="student" property="*"/>