The value for the useBean class attribute java.lang.Integer is invalid

Hi,

In my jsp I import the beans from my dispatcher class. I use Strings all the time and it works fine and als Vectors. Now I need some beans from the type Integer and I get an error in my jsp page.

Here's a piece of my code:

<%@ include file="/general/header.jsp" %>

<jsp:useBean id="offset" scope="request" class="java.lang.Integer" />

<jsp:useBean id="limit" scope="request" class="java.lang.Integer" />

<jsp:useBean id="numberofitems" scope="request" class="java.lang.Integer" />

<jsp:useBean id="resultitems" scope="request" class="java.util.Vector" />

<SCRIPT language="javascript">

<%

I am getting the following error:

org.apache.jasper.JasperException: /buy/viewitems.jsp(2,0) The value for the useBean class attribute java.lang.Integer is invalid.

org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)

org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)

I am using tomcat 6

Do I need to inlcude extra libraries in my tomcat?

Any help is welcome.

Thanks,

Jarno

[1533 byte] By [jposthuma] at [2007-11-27 6:59:10]
# 1

Integer is invalid as a bean, because it does not have a public constructor that takes no arguments.

An Integer does not really work as a "bean" It is a value which should be incorporated as part of a bean.

You might trytype="java.lang.Integer" rather than class

Are these values already set up and defined in request scope?

I would recommend converting to JSTL rather than using scriptlets in a jsp page, but thats just my opinion :-)

Cheers,

evnafets

evnafetsa at 2007-7-12 18:49:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thanks. I am using type now and it works fine.
jposthuma at 2007-7-12 18:49:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...