Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to know the device type in JSP.  RSS feed

 
surya sudhakar
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!