JSP error
[nobr]Hi
I am new to JSP, and sorry for that inappropriate subject line as I was not sure how to the right subject there.
I am using Tomcat 5.0, and I was practicing a simple JSP when I got this error can somebody help.
THE JSP code is:
<!-- Set the scipting language to java -->
<%@ page language="java" %>
<HTML>
<HEAD>
<BODY>
<!-- Instantiate the Counter bean with a id of"counter" -->
<jsp:useBean id="counter" scope="session"
class="chapter2.Counter"/>
<%
// write the current value of the property count
out.println("Count from scriptlet code:"
+ counter.getCount() +"<BR>");
%>
<!-- Get the bean's count property, -->
<!-- using the jsp:getProperty action. -->
Count from jsp:getProperty:
<jsp:getProperty name="counter" property ="count" /><BR>
</BODY>
</HTML>
The Java code is:
/**
*
*/
package chapter2;
/**
* @author Riaz
*
*/
publicclass Counter{
int count =0;
public Counter(){
}
publicint getCount(){
count++;
return count;
}
publicvoid setCount(int count){
this.count = count;
}
}
The error that I am getting is:
org.apache.jasper.JasperException: Cannot find any information on property'count' in a bean of type'chapter2.Counter'
The jsp pages are in the jsp folder of WEB-INF directory and the class file is in chapter2 directory.
Can anyone please help me in finding out what the error is? Also I dont know how to compile in Eclipse IDE, so I went to the command prompt and compiled the file there and copied the class file to the respective directory.
Please help me in this also.
Thanks in advance.[/nobr]

