You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ole Lambæk <ol...@lambaek.net> on 2002/09/15 20:18:33 UTC
Component class problem
Hello,
I'm developing a small web application on jakarta-tomcat 4.0.4, where I
have a class named Component located in a package called test, with a
single method "public String getData()".
I wan't to use this class in a JSP with <jsp:useBean id="comp"
scope="request" class="test.component" /> and retrive data with
<jsp:getProperty name="comp" property="data" /> but tomcat (jasper to
be more precise) doesn't make the page into a servlet the error is:
org.apache.jasper.JasperException: Cannot find any information on
property 'data' in a bean of type 'test.Component'
If I change the getProperty to <jsp:getProperty name="comp"
property="name" /> then jasper makes the servlet sourcecode which
ofcourse cannot compile, because there is no getName() in test.Component
but java.awt.Component has one ... For me it looks like jasper
recognizes test.Component as java.awt.Component when it makes the JSP
into a servlet.
If I change the name of test.Component to test.component (small c versus
large C) then it works like I want it to ...
I have also tested this in Caucho Resin 2.1.4, where it works like it
should, both with a small and a large c in Component...
Is this a bug, or is the Component name for a class a reserved word in
the JSP / Servlet specification ?!
Regards
Ole Lambæk
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Component class problem
Posted by Ole Lambæk <ol...@lambaek.net>.
Hello,
I place my *.class files in /WEB-INF/classes/, changing the name of the
class (renaming the java file and recompiling ofcourse) makes the page
work, it is only when I use the name Component with a large C that it
fails...
I can reproduce the "error" on several computers...
Isn't /WEB-INF/classes/ the right place to store the class files ?! If
not why is it then working when I call the class component, instead of
Component ?!
Regards
Ole Lambæk
Jean-Francois Arcand wrote:
> Hi,
>
> how are you packaging your code? It certainly not related to AWT. Jasper
> is actually not able to find your class using its classloader. Have you
> place your bean code under the lib directory?
>
> -- Jeanfrancois
>
> Ole Lambæk wrote:
>
>> Hello,
>>
>> I'm developing a small web application on jakarta-tomcat 4.0.4, where
>> I have a class named Component located in a package called test, with
>> a single method "public String getData()".
>>
>> I wan't to use this class in a JSP with <jsp:useBean id="comp"
>> scope="request" class="test.component" /> and retrive data with
>> <jsp:getProperty name="comp" property="data" /> but tomcat (jasper to
>> be more precise) doesn't make the page into a servlet the error is:
>> org.apache.jasper.JasperException: Cannot find any information on
>> property 'data' in a bean of type 'test.Component'
>>
>> If I change the getProperty to <jsp:getProperty name="comp"
>> property="name" /> then jasper makes the servlet sourcecode which
>> ofcourse cannot compile, because there is no getName() in
>> test.Component but java.awt.Component has one ... For me it looks like
>> jasper recognizes test.Component as java.awt.Component when it makes
>> the JSP into a servlet.
>> If I change the name of test.Component to test.component (small c
>> versus large C) then it works like I want it to ...
>> I have also tested this in Caucho Resin 2.1.4, where it works like it
>> should, both with a small and a large c in Component...
>>
>> Is this a bug, or is the Component name for a class a reserved word in
>> the JSP / Servlet specification ?!
>>
>> Regards
>> Ole Lambæk
>>
>>
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
>>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Component class problem
Posted by Ole Lambæk <ol...@lambaek.net>.
Hello,
I have now tested the problem in Tomcat 4.1.10, and I am still expireng
the same problems... If /WEB-INF/classes is an allowed location for
storing the class files, then I'am afraid that this is a tomcat bug...
To demonstrate it I have placed to zip files here:
http://lambaek-net.dk/temp/jsp/ the one with a component class, with a
large C and the other with a small c... If anyone get the one with a
large C working, then I would be very glad to hear how to accomplish
that ...
Regards
Ole Lambæk
Jean-Francois Arcand wrote:
> Hi,
>
> how are you packaging your code? It certainly not related to AWT. Jasper
> is actually not able to find your class using its classloader. Have you
> place your bean code under the lib directory?
>
> -- Jeanfrancois
>
> Ole Lambæk wrote:
>
>> Hello,
>>
>> I'm developing a small web application on jakarta-tomcat 4.0.4, where
>> I have a class named Component located in a package called test, with
>> a single method "public String getData()".
>>
>> I wan't to use this class in a JSP with <jsp:useBean id="comp"
>> scope="request" class="test.component" /> and retrive data with
>> <jsp:getProperty name="comp" property="data" /> but tomcat (jasper to
>> be more precise) doesn't make the page into a servlet the error is:
>> org.apache.jasper.JasperException: Cannot find any information on
>> property 'data' in a bean of type 'test.Component'
>>
>> If I change the getProperty to <jsp:getProperty name="comp"
>> property="name" /> then jasper makes the servlet sourcecode which
>> ofcourse cannot compile, because there is no getName() in
>> test.Component but java.awt.Component has one ... For me it looks like
>> jasper recognizes test.Component as java.awt.Component when it makes
>> the JSP into a servlet.
>> If I change the name of test.Component to test.component (small c
>> versus large C) then it works like I want it to ...
>> I have also tested this in Caucho Resin 2.1.4, where it works like it
>> should, both with a small and a large c in Component...
>>
>> Is this a bug, or is the Component name for a class a reserved word in
>> the JSP / Servlet specification ?!
>>
>> Regards
>> Ole Lambæk
>>
>>
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
>>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Component class problem
Posted by Jean-Francois Arcand <jf...@apache.org>.
Hi,
how are you packaging your code? It certainly not related to AWT. Jasper
is actually not able to find your class using its classloader. Have you
place your bean code under the lib directory?
-- Jeanfrancois
Ole Lambæk wrote:
> Hello,
>
> I'm developing a small web application on jakarta-tomcat 4.0.4, where
> I have a class named Component located in a package called test, with
> a single method "public String getData()".
>
> I wan't to use this class in a JSP with <jsp:useBean id="comp"
> scope="request" class="test.component" /> and retrive data with
> <jsp:getProperty name="comp" property="data" /> but tomcat (jasper to
> be more precise) doesn't make the page into a servlet the error is:
> org.apache.jasper.JasperException: Cannot find any information on
> property 'data' in a bean of type 'test.Component'
>
> If I change the getProperty to <jsp:getProperty name="comp"
> property="name" /> then jasper makes the servlet sourcecode which
> ofcourse cannot compile, because there is no getName() in
> test.Component but java.awt.Component has one ... For me it looks like
> jasper recognizes test.Component as java.awt.Component when it makes
> the JSP into a servlet.
> If I change the name of test.Component to test.component (small c
> versus large C) then it works like I want it to ...
> I have also tested this in Caucho Resin 2.1.4, where it works like it
> should, both with a small and a large c in Component...
>
> Is this a bug, or is the Component name for a class a reserved word in
> the JSP / Servlet specification ?!
>
> Regards
> Ole Lambæk
>
>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>