You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Hunter Hillegas <li...@lastonepicked.com> on 2003/06/05 21:14:42 UTC

Formatting a Date/String Inside a Tag

I am converting a Web app from scriplets to Struts.

I have the current scriptlet garbage:

Date Shipped: (MM/DD/YYYY) <INPUT TYPE="text" NAME="date_shipped" VALUE="<%
if (theRequestPartBean.getDateShipped() != null) { %><%=
formatter.format(theRequestPartBean.getDateShipped()) %><% } %>">

In my ActionForm, dateShipped is a String created from a Date object. I need
to format the output to a specific format for Struts to display in the form
element. A JavaScript control reads this field and expects a certain format.

I tried something like this, with no luck:

Date Shipped: (MM/DD/YYYY) <nested:test
property="dateShipped"><fmt:formatDate value="${dateShipped}"
/></nested:text>

Any ideas how I can pull this off?

Thanks,
Hunter


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org