title: Detect tablet or desktop user
body: <p>I plan to have a completely separate layout/design for a desktop Vs tablet user. My app is based on Java.
  My questions are;
  1. What is the best approach to detect whether the request is coming from desktop or tablet (iPad/Xoom, etc)
  2. Can this be handled at server-side and not through JS user-agent string?</p>
  
  <p>A live example of redirect is if one tries to access Yahoo. i.e. if the request comes from a desktop browser, we’ll be redirected to www.yahoo.com , while if the request comes from a tablet device like iPad, we’ll be redirected to www.yahoo.com/tablet
  I am planning something along the Yahoo example. Not sure how they have implemented it. </p>
  
  <p>I know some of you might be thinking that I should just control 2 separate CSS like desktop.css and tablet.css and detect through CSS media query OR JS user-agent. But the point is the layout/design is so different between the 2 that I just cannot control only via CSS and that is the reason, I plan to have a separate tablet version of my web app and do the redirection.</p>
  
  <p>Please let me know as much suggestions that you can.</p>
  
  <p>Thanks in advance for your help on this.</p>