IntelliJ Java IDE
The moose likes JSP and the fly likes how to know the device type in JSP. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "how to know the device type in JSP." Watch "how to know the device type in JSP." New topic
Author

how to know the device type in JSP.

surya sudhakar
Greenhorn

Joined: Jun 11, 2002
Posts: 18
Hi All,
Our application supports both PC as well as hand held devices for the business.
the PC will have standard browser and the Handheld device will have mini version of the browser. I am planning to write a controller servlet or jsp which finds out the device type and sends the different version of jsp to the individual devices. This is because the browser in handheld devices doesn't support screens which have heavy graphics and heavy content.
Can you pl give me some pointers how to identify the device type in the controller.
Thanks in advance.
Sudhakar.Y
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 11862
Seems to me you should be able to find out the kind of browser used from the request headers. I would try request.getHeaderNames() which returns an Enumeration of header name strings.
You might have to cast the request reference to HttpServletRequest in order to use getHeaderNames.
Bill


Java Resources at www.wbrogden.com
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
vydeek,
Please change your name to be compliant with JavaRanch's naming policy. It should not be obviously fictitious.
Your displayed name should be 2 separate names with more than 1 letter each. We really would prefer that you use your REAL name.
You can change your name: here.
Thanks,
Cindy


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
 
subject: how to know the device type in JSP.
 
Threads others viewed
Sending SMS thru Palm
PC vs X-BOX/PS2
Need to identify tools for synchronizing application/data with server
Bar code reading
Defining CSS for Blackberry and PC
developer file tools