(keitai-l) Re: How to find the phone serial no.

From: Curt Sampson <cjs_at_cynic.net>
Date: 08/21/01
Message-ID: <Pine.LNX.4.33.0108211123460.16009-100000@denkigama.nat.shibuya.blink.co.jp>
On Mon, 20 Aug 2001, Nik Frengle wrote:

> No. Using the utn attribute tells the i-mode server to include the serial
> number in the environmental variable HTTP_USER_AGENT....
> I don't know if you even use PHP, but you get the idea, I think. You said
> servelet, so you would need to look at what classes you have in Java to get
> environmental variables.

Quick summary, for the curious:

1. Only when you use CGI from an appropriate web server, the environment
variable HTTP_USER_AGENT is set by the web server to the contents of
the HTTP user-agent header line. It's the user-agent header line that
actually carries this information.

2. In a Java servlet environment, use the getHeader("user-agent") method
in the javax.servlet.http.HttpServletRequest object to get the user-agent
header line.

3. There is no access to environment variables in Java. (Well, there
are deprecated methods, but they're not supposed to be used, and they're
likely to vanish at some point.) The Java equivalant of the environment
is the system properties, but that's not shared with the OS.

If ever you're interested in what's actually going out from a browser,
you can always point it at

    http://www.blink.com/servlets/ShowInfo

Feel free to add any parameters you like, do form post submits, etc. As
well, you can vary input and output encodings; use

    http://www.blink.com/servlets/I18NForm

to generate example forms that do this.

The ShowInfo page doesn't work so well for i-mode, as it's got tables
and is formatted pretty badly, but I never got around to writing an
i-mode version.

cjs
-- 
Curt Sampson  <cjs_at_cynic.net>   +81 3 5778 0123   http://www.netbsd.org
    Don't you know, in this new Dark Age, we're all light.  --XTC


[ Need archives? How to unsubscribe? http://www.appelsiini.net/keitai-l/ ]
Received on Tue Aug 21 05:22:25 2001