[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index] [Home]

Re: compilation exception


On Fri, 15 Jan 1999, Vincent Partington wrote:
>Hi Kit,
>
>Kit McCormick wrote:
>> I'm getting an error while trying to use a bean in a servlet:
>> 
>> Method getName() not found in class java.lang.Object
>> out.print(__valueOf( hello.getName() ));
>> 
>> where 'hello' is supposed to be an instance of HelloBean, not Object..
>> 
>> My jsp file looks like:
>> 
>> <%@ import = "HelloBean" %>
>
>I don't think you need this.
>
>> <BEAN NAME-"hello" CLASS="HelloBean"
>            ^
>What happens if you replace this with an equals-sign? I don't know why
>GNUJSP even accepted this file, because the NAME-parameter is mandatory.
>
>Regards, Vincent.

Thanks for the response.  The '-' sign is a typo in my email; the code does
have an '=' sign.  Nonetheless, it turned out to be an ID 10 T error.
I put the bean in a package: com.gims.HelloBean, and prepended the package
name to the 'CLASS' parameter value and included  the 'TYPE' parameter in
the BEAN tag, like this:

<bean name="hello" class="com.gims.HelloBean" TYPE="com.gims.HelloBean"
introspect="yes" create="yes" scope="session">

Now it works.   I'm fairly certain the 'TYPE' parameter is what fixed it.


Thanks.
Kit