use of io.undertow.servlet.compat.rewrite.RewriteConfig in project undertow by undertow-io.
the class RewriteTestCase method setup.
@BeforeClass
public static void setup() throws ServletException {
DeploymentUtils.setupServlet(new ServletExtension() {
@Override
public void handleDeployment(DeploymentInfo deploymentInfo, ServletContext servletContext) {
deploymentInfo.addOuterHandlerChainWrapper(new HandlerWrapper() {
@Override
public HttpHandler wrap(HttpHandler handler) {
byte[] data = "RewriteRule /foo1 /bar1".getBytes(StandardCharsets.UTF_8);
RewriteConfig config = RewriteConfigFactory.build(new ByteArrayInputStream(data));
return new RewriteHandler(config, handler);
}
});
}
}, new ServletInfo("servlet", PathTestServlet.class).addMapping("/"));
}
Aggregations