🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.java.beans
1 messages
1 total messages Started by Louis-Philippe Brochu Tue, 15 Jan 2002 22:58
No polymorphism with jsp:getProperty??
#10
Author: Louis-Philippe Brochu
Date: Tue, 15 Jan 2002 22:58
29 lines
1969 bytes
Hi,

I have a small jsp page that use a bean. My bean derive from a base class
and i only use reference to the base class to make my code reusable.

Here's my code:

the bean "myBean" is already initialized with a derived bean (let's call it
the DerivedBean class).

<jsp:useBean id="myBean" scope="session" class="com.sample.beans.BaseBean"/>

Bean value: <%= myBean.getValue() %>
<BR>
Bean value: <jsp:getProperty name="myBean" property="value"/>

The problem is that the first line (<%= ... %>) works and return the correct
value, that is, the value stored in the DerivedBean class. The other line
return the value of the BaseBean instead. I cannot use polymorphism if i use
the getProperty tag according to my tests.

I use Tomcat 3.2 installed with Borland JBuilder 5. Can someone help me? Is
this normal? I hope not...

Thanks,

--
Louis-Philippe Brochu
lpbrochu@dra.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads