This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Date format problem when using URLConnection to a JSP (JSTL 1.1)

 
Helen Shen
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a very simple JSP with only one liner in the body


Opening the page in the browser, I see the expected result - 08/20/08

However, when I use URLConnection to connect to the same JSP, somehow the formatting is lost. The URLConnection's getInputStream gave me the date in
"Wed Aug 20 16:15:35 EDT 2008" format.

Any idea?
[ August 20, 2008: Message edited by: Helen Shen ]
 
Steve Luke
Bartender
Pie
Posts: 4181
21
IntelliJ IDE Java Python
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<sorry double post>
[ August 20, 2008: Message edited by: Steve Luke ]
 
Steve Luke
Bartender
Pie
Posts: 4181
21
IntelliJ IDE Java Python
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you give us the code you are using on the URLConnection to get the value returned from the server?
 
Helen Shen
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP on the server:



URLConnection Code:




Result:


[ August 20, 2008: Message edited by: Helen Shen ]
 
Helen Shen
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure why, but adding this line of code solved the problem!!!


My thought was that no matter what the user-agent is, the output html should be the same...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic