Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with JSTL date

 
Justin Howard
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am trying to display the date from the database. If I do not apply any formatting it displays correctly, but if I apply any formatting it does not display.


Also, how can I display the current date and Time of New York, irrespective of the login location of the user in jstl?

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64851
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does a View Source in the browser reveal?
 
Justin Howard
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The view source ::

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64851
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whenever something isn't displaying correctly, this should always be your first debugging step.

So now you know that you need to figure out why your JSTL tags aren't evaluating.
 
Justin Howard
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I added this

but now it is throwing an exception


How should I display it. All the examples on the net are like this
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64851
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably the wrong URI.

You haven't provided what versions of JSP and JSTL you are using as directed by the forum instructions.


 
Justin Howard
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP :: 2.5/2.1
I have jstl.jar and jstl-standard.jar in my build path.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64851
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For that version of JSP, make sure that you have the JSTL 1.2 (again, you didn't say which version) jar in your WEB-INF/lib (there's only one jar file needed) and fix your JSTL URI. The one you are using is for JSTL 1.0.
 
Justin Howard
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot!

I had one more question.
how can I display the current date and Time of New York, irrespective of the login location of the user in jstl?

Thanks

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64851
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Specify the time zone.
 
rmail kumar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friend

use the code it will work

<fmt:formatDate value="" pattern="" />
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic