public Request process(Request request)
{
final String path = request.getPath();
if (path.equals("/struts"))
{
request = new SimpleRequestWrapper(request, "/jsf");
}
return request;
}
};
URLRewriterRule rule2 = new URLRewriterRule() {
public Request process(Request request)
{
final String path = request.getPath();
if (path.equals("/jsf"))
{
request = new SimpleRequestWrapper(request, "/tapestry");
}
return request;
}
};
URLRewriterRule rule3 = new URLRewriterRule() {
public Request process(Request request)
{
String path = request.getPath();
if (path.equals("/tapestry"))
{
path = "/" + SUCCESS_PAGE_NAME;
request = new SimpleRequestWrapper(request, path);
}
return request;
}
};
URLRewriterRule rule4 = new URLRewriterRule() {
public Request process(Request request)
{
String serverName = request.getServerName();
String path = request.getPath();
if (serverName.equals(IntegrationTests.SUBDOMAIN) && path.equals("/"))
{
path = String.format("/%s/%s", SUCCESS_PAGE_NAME, IntegrationTests.LOGIN);
request = new SimpleRequestWrapper(request, path);
}
return request;
}
};
URLRewriterRule rule5 = new URLRewriterRule() {
public Request process(Request request)
{
String serverName = request.getServerName();
String path = request.getPath();
final String pathToRewrite = "/" + SUCCESS_PAGE_NAME + "/login";
if (serverName.equals("localhost") && path.equalsIgnoreCase(pathToRewrite))
{
request = new SimpleRequestWrapper(request, IntegrationTests.SUBDOMAIN, "/");
}
return request;
}
};
URLRewriterRule rule6 = new URLRewriterRule() {
public Request process(Request request)
{
String serverName = request.getServerName();
String path = request.getPath().toLowerCase();
if (serverName.equals("localhost") && path.equals("/dummy"))
{
request = new SimpleRequestWrapper(request, "/notdummy");
}
return request;
}