aspose file tools*
The moose likes JSP and the fly likes Problem with JSTL date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Problem with JSTL date" Watch "Problem with JSTL date" New topic
Author

Problem with JSTL date

Justin Howard
Ranch Hand

Joined: Feb 19, 2009
Posts: 162
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

Joined: Jan 10, 2002
Posts: 61426
    
  67

What does a View Source in the browser reveal?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Justin Howard
Ranch Hand

Joined: Feb 19, 2009
Posts: 162
The view source ::

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61426
    
  67

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

Joined: Feb 19, 2009
Posts: 162
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

Joined: Jan 10, 2002
Posts: 61426
    
  67

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

Joined: Feb 19, 2009
Posts: 162
JSP :: 2.5/2.1
I have jstl.jar and jstl-standard.jar in my build path.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61426
    
  67

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

Joined: Feb 19, 2009
Posts: 162
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

Joined: Jan 10, 2002
Posts: 61426
    
  67

Specify the time zone.
rmail kumar
Greenhorn

Joined: Jun 09, 2008
Posts: 9
Hello friend

use the code it will work

<fmt:formatDate value="" pattern="" />
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with JSTL date