On Mon, 30 Apr 2001, Mark Simms wrote:

> Uh....hate to ask a stupid question, but why wasn't the vendor-info
> standardized in the J2EE spec ?
> 

Well, I could also ask why the information format browsers send in a
"User-Agent" header isn't standardized ... :-)

Actually, the Javadocs for ServletContext.getServerInfo() do document a
standardized format -- however, the version number returned is the version
number of the server, not the specs it implements.  The latter info you
can get from getMajorVersion()/getMinorVersion().  You also won't be able
to generalize much on any information included in the parentheses (or even
assume that parentheses are present), because there is so much variation.

> If I need to implement conditional logic based on a vendor's app server, how
> can it be done ?
> Create a session-scoped attribute with the appserver designation read from a
> pre-set properties file or what ?
> 

The way most apps deal with this for browsers is they create a set of
Strings that are searched for in the value returned for the User-Agent
header (first match wins).  You could do the same thing for the value
returned by getServerInfo().

Craig



Reply via email to