code: public static void redirect(String url, boolean copyParameters, ServletRequest req, ServletResponse res)
  	{
  		if(url == null)
  		{
  			throw new IllegalArgumentException("URL cannot be null");
  		}
  		String redirectUrl = url;
  		char separator = '?';
  		if (redirectUrl.indexOf('?') != -1)
  		{
  			separator = '&';
  		}
  		if(copyParameters)
  		{
  			Enumeration e = req.getParameterNames();
  			while (e.hasMoreElements())
  			{
  				String name = (String) e.nextElement();
  				String value = req.getParameter(name);
  				redirectUrl += separator + name + '=' + value;
  				separator = '&';
  			}
  			e = req.getAttributeNames();
  	/*		while (e.hasMoreElements())
  			{
  				String name = (String) e.nextElement();
  				String value = req.getParameter(name);
  				redirectUrl += separator + name + '=' + value;
  				separator = '&';
  			}  */
  		}
  		System.out.println(new LogEntry("about to redirect to " + redirectUrl));
  		try
  		{
  			((HttpServletResponse)res).sendRedirect(redirectUrl);
  		}
  		catch(IOException ioe)
  		{
  			throw new ResourceException("redirect to '" + redirectUrl + "' failed with message: " +
  			ioe.getMessage(), ioe);
  		}
  	}
docs: Redirects http-request to url
  
  @param url