I doubt JSTL will be any happier with a class that's trying to be both a
Map and a JavaBean:
<%@ page contentType="text/plain" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>
map.class:
obj.class:
map.class:
Produces:
map.class:
obj.class: class java.lang.Object
map.class:
I have read about people having problems getting or setting a bean which
does not fit the bean specification. In that case the Cart object would
also need a setSubTotal(double dbl) method, even if it is not used eg
public class Cart extends HashMap {
private double subTotal = 400.00;
publ
ure in a different context.
Thanks,
--Mike M.
-Original Message-
From: Kris Schneider [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 27, 2003 10:13 AM
To: Struts Users Mailing List
Subject: Re: not writing?
I'm pretty sure this boils down to the way Propert
s Users Mailing List
Subject: Re: not writing?
I'm pretty sure this boils down to the way PropertyUtils works.
will use PropertyUtils.getProperty(bean, property) to
retrieve the "subTotal" property from the bean "cart". PropertyUtils
will test whether or not "cart&q
EMAIL PROTECTED]
Sent: Saturday, December 27, 2003 10:08 AM
To: Struts Users Mailing List
Subject: Re: not writing?
Fair enough
The only other thing i can think of is to use jstl or old jsp tags
instead
or try using the scope attribute of bean:write
JSTL give better debug info even if it do
yeah buddyneed the tld for 'c'
, declare the uri in the web.xml and the refer to that uri in ur jsp page.
-Original Message-
From: Michael Marrotte [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 27, 2003 10:24 AM
To: Struts Users Mailing List
Subject: RE: n
works.
But,
Does not...
Mean anything?
Do I need a taglib descriptor for ?
--Mike M.
-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 27, 2003 10:08 AM
To: Struts Users Mailing List
Subject: Re: not writing?
Fair enough
The only other
I'm pretty sure this boils down to the way PropertyUtils works.
will use PropertyUtils.getProperty(bean, property) to
retrieve the "subTotal" property from the bean "cart". PropertyUtils
will test whether or not "cart" is a Map (which it is) and then call
Map.get to retrieve the property value
lto:[EMAIL PROTECTED]
Sent: Saturday, December 27, 2003 9:52 AM
To: Struts Users Mailing List
Subject: Re: not writing?
Aren't tags usually in /WEB-INF?
On 27 Dec 2003, at 14:57, Michael Marrotte wrote:
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
is at th
, 2003 9:54 AM
To: 'Struts Users Mailing List'
Subject: RE: not writing?
hi,
it must end with
.tld
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
and place the file in /WEB-INF
-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Se
:[EMAIL PROTECTED]
Sent: Saturday, December 27, 2003 9:52 AM
To: Struts Users Mailing List
Subject: Re: not writing?
Aren't tags usually in /WEB-INF?
On 27 Dec 2003, at 14:57, Michael Marrotte wrote:
> <%@ taglib uri="/tags/struts-bean" prefix="bean" %>
>
>
hi,
it must end with
.tld
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
and place the file in /WEB-INF
-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 27, 2003 3:52 PM
To: Struts Users Mailing List
Subject:
[mailto:[EMAIL PROTECTED]
Sent: Saturday, December 27, 2003 9:48 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: not writing?
Michael;
Did you forget to specify the taglib directive for bean:write tag
library in
your JSP? In such case, have following in your JSP.
<%@ taglib uri="
[EMAIL PROTECTED]
Subject: RE: not writing?
Michael;
Did you forget to specify the taglib directive for bean:write tag library in
your JSP? In such case, have following in your JSP.
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
Hope this helps.
Sharad
Michael;
Did you forget to specify the taglib directive for bean:write tag library in
your JSP? In such case, have following in your JSP.
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
Hope this helps.
Sharad
From: "Michael Marrotte" <[EMAIL PROTECTED]>
Reply-To: <[EMAIL PROTECTED
Here's the bean:
public class Cart extends HashMap {
private double subTotal = 400.00;
public double getSubTotal(){return subTotal;}
}
Here's the Java:
session.setAttribute("cart", new Cart());
Here's the JSP
// no output?
<%= ((csp.Cart)session.getAttribute("cart")).getSubTotal() %
16 matches
Mail list logo