🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.java.beans
Article #10

No polymorphism with jsp:getProperty??

#10
From: 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
Technical Details
Message-ID: <a22c6v$ufi7f$1@ID-74935.news.dfncis.de>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!dhcp132.multilis.dra.COM!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fcfbb,92fc03cd1b0313c4,start
X-Google-Attributes: gidfcfbb,public
X-Google-Thread: f4be4,92fc03cd1b0313c4,start
X-Google-Attributes: gidf4be4,public
X-Google-ArrivalTime: 2002-01-15 14:58:41 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!dhcp132.multilis.dra.COM!not-for-mail
From: "Louis-Philippe Brochu" <lpbrochu@yahoo.com>
Newsgroups: comp.lang.java.beans,borland.public.jbuilder.servlets-jsp
Subject: No polymorphism with jsp:getProperty??
Date: Tue, 15 Jan 2002 17:58:00 -0500
Lines: 33
Message-ID: <a22c6v$ufi7f$1@ID-74935.news.dfncis.de>
NNTP-Posting-Host: dhcp132.multilis.dra.com (207.61.150.132)
X-Trace: fu-berlin.de 1011135519 31967471 207.61.150.132 (16 [74935])
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000