Created
May 13, 2014 20:45
-
-
Save ortense/1d576a755ad7b6221f20 to your computer and use it in GitHub Desktop.
Redirect page in JSP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
String requestURL = request.getRequestURL().toString(); | |
String queryString = request.getQueryString(); | |
String redirectUrl = "http://redirect.to/path"; | |
if (queryString != null) redirectUrl += "?" + queryString; | |
response.setStatus(301); | |
response.setHeader( "Location", redirectUrl); | |
response.setHeader( "Connection", "close" ); | |
%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment