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]

[2903 byte] By [ruuddina] at [2007-10-2 23:57:53]
# 1
Is there no help?
ruuddina at 2007-7-14 16:44:52 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
did you set first the value of the bean before you get some values from it?
jgalacambraa at 2007-7-14 16:44:52 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

i put the jsp code in the examples\jsp directory and the class file in the

WEB-INF \class directory and it worked for me

and got an output

Count from scriptlet code:1

Count from jsp:getProperty: 2

try the same by putting ur jsp pages in the examples\jsp and try to run that.

dgpa at 2007-7-14 16:44:52 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...