This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Java Beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Java Beans" Watch "Java Beans" New topic
Author

Java Beans

bruno martins
Greenhorn

Joined: Oct 28, 2003
Posts: 8
Hi, i have a problem error
org.apache.jasper.JasperException: CounterBean
my code:
<%@ page import="com.bruno.CounterBean" %>
<jsp:useBean id="session_counter" class="CounterBean" scope="session" />
<jsp:useBean id="app_counter" class="CounterBean" scope="application" />
<%
session_counter.increaseCount();
synchronized(page) {
app_counter.increaseCount();
}
%>
<h3>
Number of accesses within this session:
<jsp:getProperty name="session_counter" property="count" />
</h3>
<p>
<h3>
Total number of accesses:
<% synchronized(page) { %>
<jsp:getProperty name="app_counter" property="count" />
<% } %>
</h3>
package com.bruno;
public class CounterBean {
int count;
public int getCount() {
return count;
}
public void increaseCount() {
count++;
}
}
[ December 09, 2003: Message edited by: Bear Bibeault ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

You need to specify the fully qualified class name of the bean. E.g.:

bear
[ December 09, 2003: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
 
subject: Java Beans
 
Similar Threads
synchronized(page) is jsp
Question in getProperty
getProperty not accessing correct object
jsp:useBean problem
invalid useBean attribute error