File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Request Object Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Request Object" Watch "Request Object" New topic
Author

Request Object

Pradeep Chandrasekharan Nair
Ranch Hand

Joined: Apr 01, 2004
Posts: 48
i am working on a project where in i have to display date according to the client machines date format. is there any way where i can get client machines date format in my servlet through request object. Thanks in advance.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

The best way it to ask the client which locale they are in (or want to use). There are ways to get locale info from the client though the request, but none are as reliable as just plain asking.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Here is a typical set of headers from a request and a response.
As you can see, the server sends it's date/time in a header but the browser doesn't send that information.

You will probably need to do this with Javascript.



[this time Paul beat me... ]
[ June 21, 2005: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Request Object
 
Similar Threads
java.text.ParseException in Web service
Java Date formatting problem
SOAP and WebServices is a fad?
Date validation in JAVA
JSP abd Date Object