title: Correct way to Redirect based on browser user-agent?
body: <p>I am building a Spring MVC based application where I want to redirect user's to specific portion of the site based on their browser.</p>
  
  <p>I am using a Filter applied to /site/home.jsp to read the User-Agent to determine the browser type. </p>
  
  <pre><code>HttpServletRequest req = (HttpServletRequest) request;
  String uaString = req.getHeader("User-Agent");
  </code></pre>
  
  <p>Further I want to redirect users as below:</p>
  
  <ul>
  <li>Firefox: redirect to /site/firefox/home.jsp</li>
  <li>IE: redirect to /site/ie/home.jsp</li>
  <li>Unknown: redirect to /site/UnsupportedBrowser.jsp</li>
  </ul>
  
  <p>My confusion is what is the correct way to redirect the user from my BrowserDetector filter?</p>
  
  <p>1) Simply redirect the user?</p>
  
  <pre><code>resp.sendRedirect("/AppName/site/ie/home.jsp");
  </code></pre>
  
  <p>2) Use an HTTP Temp redirect?</p>
  
  <pre><code>resp.setStatus(HttpServletResponse.SC_TEMPORARY_REDIRECT);
  resp.setHeader("Location", "/AppName/site/ie/home.jsp");
  </code></pre>
  
  <p>3) Server side redirect?</p>
  
  <pre><code>RequestDispatcher request_Dispatcher=request.getRequestDispatcher("/ie/home.jsp");
  request_Dispatcher.forward(request,response);
  </code></pre>
  
  <p>4) Any other correct way?</p>