title: Spring MVC Relative Redirect from HttpServletResponse
body: <p>Given this methodology of relative redirect to another controller:</p>
  
  <pre><code>@Controller
  @RequestMapping("/someController")
  public class MyController {
      @RequestMapping("/redirme")
      public String processForm(ModelMap model) {            
          return "redirect:/someController/somePage";
      }
  }
  </code></pre>
  
  <p>How can I simulate that same <em>relative</em> redirect given that I'm within an interceptor? </p>
  
  <pre><code>public class MyInterceptor extends HandlerInterceptorAdapter {
      @Override
      public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
      {
          response.sendRedirect("/someController/somePage");
          return false;
      }
  }
  </code></pre>
  
  <p>Now with the interceptor, i will end up at application.com/someController/somePage when I really want to be at application.com/deployment/someController/somePage. Surely there must be a 'spring' solution for this?</p>