Link to home
Create AccountLog in
Avatar of iharsh
iharshFlag for United States of America

asked on

Date Format in html:text in struts

Hi,

In struts Action form, I have a date field.On Displaying it in JSP using html:text the format which was earlier mm/dd/yyyy automatically changes to yyyy-mm-dd.there is no "format" attribute available with the
html:text.Kindly let me know how do I preserve my date format using html:text
ASKER CERTIFIED SOLUTION
Avatar of malfunction84
malfunction84
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Pass a string to the JSP instead of a Date object. That way you can control the formatting when converting from Date to String (using, e.g. SimpleDateFormatter).