This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Servlets and the fly likes Request Object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Request Object" Watch "Request Object" New topic

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

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

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:
subject: Request Object
It's not a secret anymore!