Hi, We are developing website. In which we want to know the from where the request is originated. I mean whether it is a request from mobile browser or it is a request from desktop browser. Our objective is to find out browser type and based on that forwarding the request (mobile browser request or desktop browser request) to the particular jsp page which contains the view for the particular client.
So the question is , how to find browser type. b'cos current mobiles also have html/xhtml enabled browsers. but their screen - size prohibit to take adwantage of these languages.
At a previous company we used a combination of the user-agent and accepts header to determine micro-browser vs browser. We used a system of pattern matching to determine the best content for the device.
As stated earlier, desktop browsers can spoof header easily. However, I am not aware of the same for microbrowsers.
There are other headers that mark the use of a micro-browser such as
to name a few. It may be a good idea, after determining the browser type and presenting the first page, to include a link to the alternate version. This would help users who are identified incorrectly.
If you decide to got the user agent route, here are a list of user-agents that can help you build and test the identification portion of your code. The list is compiled from visitor statistics on hostj2me.com and organized by frequency.