Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Struts - A MVC web framework
Tomcat - JSP/Servlet container
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
JSP - A mailing list about Java Server Pages specification and reference
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
Tomcat 5.0.16 jsp:useBean of type java.util.List won 't compile

Tomcat 5.0.16 jsp:useBean of type java.util.List won 't compile

2004-01-12       - By Jason Wilson

 Back
Reply:     1     2     3  

I have some jsp pages that now break in Tomcat 5.0.16.
In particular, my use of the jsp:useBean tag is no
longer working, it fails to compile.

## <jsp:useBean id="myListBean" scope="session"
class="java.util.List Source code of java.util.List"/>

In the generated servlet, it attempts to do a

## java.util.List Source code of java.util.List.html>java.util.List Source code of java.util.List java.util.List Source code of java.util.List.java.html>Source code of <a href=http://www.docjar.com/docs/api/java/util/List.html>java.util.List</a> <a href=http://www.docjar.com/html/api/java/util/List.java.html><img src=/j.gif alt=' border=0> myListBean = new java.util.List Source code of java.util.List.html>java.util.List Source code of java.util.List java.util.List Source code of java.util.List.java.html>Source code of <a href=http://www.docjar.com/docs/api/java/util/List.html>java.util.List</a> <a href=http://www.docjar.com/html/api/java/util/List.java.html><img src=/j.gif alt=' border=0>();

which does not work, since it is not a concrete class.

In the version of Tomcat I was working with (4.1.*),
it didn't use a hard coded constructor, for example:

## myListBean = (java.util.List Source code of java.util.List)
java.beans.Beans Source code of java.beans.Beans(this.getClass().getClassLoader(),
"java.util.List Source code of java.util.List");

Using reflection to call the constructordid not create
a compile time error.  This was good, in any case,
because my JSP is never supposed to instantiate these
beans, they are created by a servlet that forwards the
request to them.

Does anyone know why this new JSP servlet generator
uses this type of constructor?  It seems like it would
break A LOT of code out there, where a JPS page uses
the useBean to get a bean that is supposed to already
be existing in the specified scope.  Or are we
supposed to only put concrete objects in our class
types, and only those that have a no-arg constructor?

Is there something new in the jsp 2.0 spec that allows
me to define a bean that will never be instantiated in
the page itself?

My workaround is to remove all the jsp:useBean tags
and just use scriptlets to get at the objects.

## <% java.util.List Source code of java.util.List.html>java.util.List Source code of java.util.List java.util.List Source code of java.util.List.java.html>Source code of <a href=http://www.docjar.com/docs/api/java/util/List.html>java.util.List</a> <a href=http://www.docjar.com/html/api/java/util/List.java.html><img src=/j.gif alt=' border=0> myList = (java.util.List Source code of java.util.List.html>java.util.List Source code of java.util.List java.util.List Source code of java.util.List.java.html>Source code of <a href=http://www.docjar.com/docs/api/java/util/List.html>java.util.List</a> <a href=http://www.docjar.com/html/api/java/util/List.java.html><img src=/j.gif alt=' border=0>)
session.getAttribute("myList"); %>

Once again, is there anyway that I can use jsp:useBean
with classes like java.util.List Source code of java.util.List or even classes that
I have written that do not provide a no-arg
constructor?

Thanks for any assistance,
Jason


__ ____ ____ ____ ____ ____ ______
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)




©2008 junlu.com - Jax Systems, LLC, U.S.A.