How run beans inTomcat
My Tomcat Server doesn't recognize my bean classes.It show the error message:The value for the useBean class attribute CounterBean is invalid..Do i need install something?
the jsp arquive:
<%@ page import="com.jguru.CounterBean" %>
<jsp:useBean id="session_counter" class="com.jguru.CounterBean" scope="session" />
<jsp:useBean id="app_counter" class="com.jguru.CounterBean" scope="application" />
the bean classse code:
package com.jguru;
public class CounterBean {
//declare a integer for the counter
int count;
public void setCount(int c){
count = c;
}
public int getCount() {
return count;
}
public void increaseCount() {
count++;
}
}
[786 byte] By [
Dan2006a] at [2007-10-3 4:52:32]

> Add the following in your code.
>
> public <your classname>{
> }
===================================
sriarumilli your creating one empty constructor in bean know that is correc thing. because each and every bean should be having one empty constructor then only it will work....
ggopia at 2007-7-14 22:57:20 >

> sriarumilli your creating one empty constructor in
> bean know that is correc thing. because each and
> every bean should be having one empty constructor
> then only it will work....
Ggopi, you ignorant twit, he already has an empty constructor.
By not creating any constructor, Java creates one implicitly for him.
Please refrain from answering questions, as you know diddly squat yourself, K?
> > sriarumilli your creating one empty constructor in
> > bean know that is correc thing. because each and
> > every bean should be having one empty constructor
> > then only it will work....
>
> Ggopi, you ignorant twit, he already has an empty
> constructor.
> By not creating any constructor, Java creates one
> implicitly for him.
>
> Please refrain from answering questions, as you know
> diddly squat yourself, K?
================================================
I think your not having eyes? You just this the program what he was sent. In that program there is no empty constructor..OK
> By not creating any constructor, Java creates one
> implicitly for him.
Ok your answer is correct. But if you go to the bean it is not like that? You should create one empty constructor then only it will work..K
ggopia at 2007-7-14 22:57:20 >
