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
bean:write name=cart property=subTotal/ // no output?
%=
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
bean:write name=cart property=subTotal/ // no output?
%=
]
To: [EMAIL PROTECTED]
Subject: bean:write not writing?
Date: Sat, 27 Dec 2003 08:51:18 -0500
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
]
Subject: RE: bean:write 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
From: Michael Marrotte [EMAIL PROTECTED
]
Sent: Saturday, December 27, 2003 9:48 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: bean:write 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
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: Re: bean:write not writing
(even bean:write) as
advertised, except in this one case.
-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 27, 2003 9:52 AM
To: Struts Users Mailing List
Subject: Re: bean:write not writing?
Aren't tags usually in /WEB-INF?
On 27 Dec 2003, at 14:57
-Original Message-
From: Matthias Wessendorf [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 27, 2003 9:54 AM
To: 'Struts Users Mailing List'
Subject: RE: bean:write not writing?
hi,
it must end with
.tld
%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
and place the file in /WEB-INF
: Saturday, December 27, 2003 9:52 AM
To: Struts Users Mailing List
Subject: Re: bean:write 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 the top of the JSP file and other bean:write tags are working
I'm pretty sure this boils down to the way PropertyUtils works.
bean:write 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
: Saturday, December 27, 2003 10:08 AM
To: Struts Users Mailing List
Subject: Re: bean:write 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
bean:write name=cart property=subTotal scope=session /
c:out
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: bean:write not writing
anything?
Do I need a taglib descriptor for c:out?
--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: bean:write not writing?
Fair enough
The only other thing i can think of is to use jstl
List
Subject: Re: bean:write not writing?
I'm pretty sure this boils down to the way PropertyUtils works.
bean:write 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
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: bean:write not writing?
I'm pretty sure this boils down to the way PropertyUtils works.
bean:write will use
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;
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; %
jsp:useBean id=map class=java.util.HashMap/
jsp:useBean id=obj class=java.lang.Object/
map.class: c:out
17 matches
Mail list logo