aspose file tools*
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 Java 8 in Action this week in the Java 8 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: 60082
    
  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]
 
jQuery in Action, 2nd edition
 
subject: Java Beans
 
Similar Threads
invalid useBean attribute error
jsp:useBean problem
getProperty not accessing correct object
synchronized(page) is jsp
Question in getProperty