You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by "Kok, Arjan" <Ar...@nl.compuware.com> on 2001/01/22 09:17:06 UTC
RE: cvs commit: jakarta-struts/web/test html-multibox.jsp html-s
etters.jsp
Sorry, I am indeed talking about the <property> or <write> tags, not about
the <html:text> tag.
So I would like to use the <bean:write> tag like this:
<bean:write property="deliveryAddress.street"/>
But what happens when mailing Address is null. I would expect that the
Struts tags display all requested properties of the deliveryAddress as a
zero lenght string if the deliveryAddress is
null. I do not like to change a model bean (model as Model in the MVC
pattern) only for getting it displayed correctly on a JSP page.
Arjan Kok.
> -----Original Message-----
> From: Ted Husted [mailto:news.ted@husted.com]
> Sent: Friday, January 19, 2001 5:41 PM
> To: Struts Dev
> Subject: RE: cvs commit: jakarta-struts/web/test html-multibox.jsp
> html-s etters.jsp
>
>
> On 1/19/2001 at 2:19 PM Kok, Arjan wrote:
> >In our application we use Entity Beans (EJB), and Entity beans can
> have a deliveryAddress with value null (when the foreign key
> relating a
> deliveryAddress to a Customer in the Customer table is null).
>
> Sorry, you did say that.-)
>
> But I was looking at this "<html:text
> property="mailingAddress.street"/> mailingAddress is null?", which
> implied that the property may be edited.
>
> For display only, you may wish to use the <bean:write > tag,
> which does
> not render output when the property is null.
>
> *********** REPLY SEPARATOR ***********
>
>
> Hello Ted,
>
> Thanks for your response.
> However, I made a distinction between displaying fields of a
> Model bean
> on a
> JSP and updating or creating a Model bean on a JSP. For updating or
> creating
> a Customer an initialized deliveryAddress should be there in the Form
> Bean,
> no doubt about this.
>
> Note that the Struts framework makes the same distinction: only for
> updating
> or creating Model beans a Form Bean is needed (so for HTML Forms).
> However, when I want to display the fields of a Model bean I do not
> like to
> change the Model bean. In our application we use Entity Beans (EJB),
> and
> Entity beans can have a deliveryAddress with value null (when the
> foreign
> key relating a deliveryAddress to a Customer in the Customer table is
> null).
>
> Regards, Arjan.
>
>
>