| Author |
Converting Date to String in JSP
|
Manoj Paul
Ranch Hand
Joined: Jan 18, 2007
Posts: 109
|
|
Please help.... wat should i do to convert Date to String in my JSP Page? Thank you....
|
 |
Muhammad Saifuddin
Ranch Hand
Joined: Dec 06, 2005
Posts: 1318
|
|
|
use Scriptlets(<% [java code] %>)and placing your java code between <% and %>.
|
Saifuddin..
[Linkedin] How To Ask Questions On JavaRanch My OpenSource
|
 |
Stefan Evans
Bartender
Joined: Jul 06, 2005
Posts: 1004
|
|
I would suggest the JSTL <fmt:formatDate> tag. Or do the date formatting in a bean, and just get the property on the page. The java class to use would be java.text.SimpleDateFormat. Putting scriptlet code on a jsp page is generally not considered best practice
|
 |
Muhammad Saifuddin
Ranch Hand
Joined: Dec 06, 2005
Posts: 1318
|
|
Originally posted by Stefan Evans: do the date formatting in a bean, and just get the property on the page. The java class to use would be java.text.SimpleDateFormat. Putting scriptlet code on a jsp page is generally not considered best practice
indeed.
|
 |
 |
|
|
subject: Converting Date to String in JSP
|
|
|