You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Craig R. McClanahan" <cr...@apache.org> on 2001/06/02 06:29:28 UTC

RE: Format on the JSP pages


On Mon, 21 May 2001, Joyce Tang wrote:

>  Sorry if I didn't make it clear.  What I am asking is how to format a
> embedded attibute?
> 

There isn't any particular support for formatting within the Struts tags
at the moment.  However, there is a formatting library in the Jakarta
Taglibs project <http://jakarta.apache.org/taglibs> that might help.

Craig


> -----Original Message-----
> From: Joyce Tang
> To: 'struts-user@jakarta.apache.org'
> Sent: 5/21/01 2:13 PM
> Subject: Format on the JSP pages
> 
> One property of my form is a customer object. 
> 
> So in the JSP page, I am displaying them as: 
> 
> <bean:write name="Customer" property="customer.dateOfBirth"
> scope="request" filter="true"/> 
> 
> How should I format it? 
> 
> Thanks 
> 
> 


Re: Format on the JSP pages

Posted by Michael Mok <mo...@hotmail.com>.
In addition to Craig's comment, if you decide to use the Jakarta Taglibs
project <http://jakarta.apache.org/taglibs> , you can this on your JSP page.

<%@ taglib uri="http://jakarta.apache.org/taglibs/datetime-1.0" prefix="dt"
%>

  <dt:format pattern="EEE MMM d, yyyy"><bean:write name="curForm"
property="startDateTime"/></dt:format>

In the above example my bean contain the following method

public long getStartDateTime() {
  //
  //  return the Calender.getTime() component;
};


Cheers

Michael Mok
www.webappcabaret.com/teatimej

----- Original Message -----
From: "Craig R. McClanahan" <cr...@apache.org>
To: <st...@jakarta.apache.org>
Cc: "Joyce Tang" <jt...@irise.com>
Sent: Saturday, June 02, 2001 12:29 PM
Subject: RE: Format on the JSP pages


>
>
> On Mon, 21 May 2001, Joyce Tang wrote:
>
> >  Sorry if I didn't make it clear.  What I am asking is how to format a
> > embedded attibute?
> >
>
> There isn't any particular support for formatting within the Struts tags
> at the moment.  However, there is a formatting library in the Jakarta
> Taglibs project <http://jakarta.apache.org/taglibs> that might help.
>
> Craig
>
>
> > -----Original Message-----
> > From: Joyce Tang
> > To: 'struts-user@jakarta.apache.org'
> > Sent: 5/21/01 2:13 PM
> > Subject: Format on the JSP pages
> >
> > One property of my form is a customer object.
> >
> > So in the JSP page, I am displaying them as:
> >
> > <bean:write name="Customer" property="customer.dateOfBirth"
> > scope="request" filter="true"/>
> >
> > How should I format it?
> >
> > Thanks
> >
> >
>
>