Identify request coming from mobile or PC
Identify request coming from mobile or PC
I am working in project which are in two version one for pc and other for mobile . for both page are different. For that i want to know the http request coming from mobile or PC . Based on that i want to show jsp page.
As already pointed out, you need to sniff the user-agent string. A little research or testing on your own will show you what returned front he different browsers.
Bear in mind that the user-agent can be spoofed so it's not 100% accurate, but it's all you've got to work with.
I wouldn't worry about the spoofing aspect; if people take care to appear as something other than what they are, then they should not be surprised to be treated as something other than what they are.
You can use MobileESP here a very efficient page and open source solution to your problem.