0

We are having two module of same web application in Servlet/jsp. One for mobile and one for desktop. I want to redirect to mobile version whenever an handheld device hit a desktop version. Since I am having two different context of same application, which will be the best approach for this. Server side device detection or client side detection and redirection.

Thanks in advance.

Jafar Ali
  • 1,084
  • 3
  • 16
  • 39

1 Answers1

1

This is no different than redirecting between two different applications (or even two different servers). You might have good reasons for separating it like this, but I would consider having only one application, and using responsive design (media queries) for serving device adapted content. But if you really want to do it as you describe, I would do the detection on the server side, as doing it client side would rely on being able to execute javascript on the client, which may or may not be enabled or blocked.

But whatever approach you choose, please, please, please let the user override this by his/her own wish. And when doing the redirect, please, please, please don't loose the context the user was trying to access in the first place. The worst thing I know are websites that redirect to a mobile website after trying to reach a specific part of the website (typically an article), and then just being redirected to the root of the website, and then having to try to locate the part of the website (article) I was looking for...

NilsH
  • 13,705
  • 4
  • 41
  • 59
  • The Desktop version is already around for some time so adapting responsive web design at such a short notice is not possible. But definitely I will keep in mind all the other suggestions. – Jafar Ali May 02 '13 at 06:21