Open GoogleCodeExporter opened 9 years ago
You can always use a workaround:
<rule>
<from>/see/other/.*</from>
<run class="com.example.Redirector" />
</rule>
package com.example;
public class Redirector {
public void run(HttpServletRequest request, HttpServletResponse response) {
response.setStatus(HttpServletResponse.SC_SEE_OTHER);
response.setHeader("Location", "http://example.com/somewhere/else");
}
}
Original comment by le.xi...@gmail.com
on 20 Jun 2011 at 8:21
Thanks for the hint. Getting this to work with urlrewritefilter 3.2 and Tomcat
7.0.16 required some extreme voodoo, though:
<rule>
<from>/see/other/.*</from>
<run class="com.example.Redirector" />
<to>Random but required garbage</to>
</rule>
package com.example;
public class Redirector {
public void run(HttpServletRequest request, HttpServletResponse response) {
String location = "http://example.com/somewhere/else";
response.setStatus(HttpServletResponse.SC_SEE_OTHER);
response.setHeader("Location", location);
response.addHeader("Content-Type", "text/plain");
String entityBody = "See Other: " + location;
response.setContentLength(entityBody.length());
response.getOutputStream().write(entityBody.getBytes());
}
}
Original comment by realworl...@gmail.com
on 3 Jul 2011 at 3:11
I submitted changes to implement a SeeOther redirect in issue 124. I probably
should have put the changes here...
Original comment by doug.whi...@gmail.com
on 16 Oct 2012 at 3:00
Original issue reported on code.google.com by
realworl...@gmail.com
on 20 Jun 2011 at 2:26