• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<sorry double post>
[ August 20, 2008: Message edited by: Steve Luke ]
 
Steve Luke
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
reply
    Bookmark Topic Watch Topic
  • New Topic