aspose file tools*
The moose likes JSP and the fly likes fmt:formatDate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "fmt:formatDate" Watch "fmt:formatDate" New topic
Author

fmt:formatDate

Brian Percival
Ranch Hand

Joined: Jun 23, 2004
Posts: 163
I ahve this....

the value of the 'value' attribute in fmt:formatDate should be a string as per documentation. channel_ts is a 'Date' object. Am I doing it wrong ?
should the value be channel_ts.toString() ???
[ October 25, 2007: Message edited by: Bear Bibeault ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

Originally posted by Brian Percival:
the value of the 'value' attribute in fmt:formatDate should be a string as per documentation

Oh?
[ October 25, 2007: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Brian Percival
Ranch Hand

Joined: Jun 23, 2004
Posts: 163
Just referring to this:

http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/fmt/formatDate.html
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

That is incorrect. The spec correctly identifies the type as a java.util.Date.
Brian Percival
Ranch Hand

Joined: Jun 23, 2004
Posts: 163
so what I am doing above, should always give formatted dates properly on display?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

I have no idea what <channel> is.
Brian Percival
Ranch Hand

Joined: Jun 23, 2004
Posts: 163
Channel means something to smeone somewhere, basically just a xml root node, in my jsp response, I am more interested in someone confirming that teh jstl syntax I am using in combination with the EL on a Date object to always printin GMT values is correct and should work fine.

The issues isk, when I hit the jsp in a browser, the datand times seem to be formatted properly, but when it is hit in otherways (say in a flash client), the dates and times are not formatted. they seem to get the tostring() version of the dates and times. I just wanto double check that what I am doing in teh jsp is right.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

Is the Flash client hitting it on a JSP-aware server?
[ November 01, 2007: Message edited by: Bear Bibeault ]
Brian Percival
Ranch Hand

Joined: Jun 23, 2004
Posts: 163
yes yes. it is the same http url that the flash client hits internally.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

Unless you've got some type of conditional processing going on, the JSP will render the same no matter what client makes the request. Are you sure that it's not the Flash client gumming up the works?
[ November 01, 2007: Message edited by: Bear Bibeault ]
Brian Percival
Ranch Hand

Joined: Jun 23, 2004
Posts: 163
No clue.. totally frustrated with this.. probably I will just replace teh Date with preformatted stirng and do away with fmt tags altogether.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

Next thing I'd do is to fetch a tool like Tamper Data for FireFox and look at the response text that's being returned to the browser.
Brian Percival
Ranch Hand

Joined: Jun 23, 2004
Posts: 163
I will do that.. Thanks
 
wood burning stoves
 
subject: fmt:formatDate