@CustomComponent(displayName = "Custom redirect (PreRequestTrigger)")
public class CustomRedirectNew implements PreRequestTrigger {
@Override
public boolean beforeQuery(Map<String, Object> modelMap, AccessRequest accessRequest,
HttpServletRequest request, HttpServletResponse response, HttpSession session) throws Exception {
response.sendRedirect("http://exalead.com");
return false;
}
@Override
public boolean afterQuery(Map<String, Object> modelMap, Map<String, ResultFeed> resultFeeds,
HttpServletRequest request, HttpServletResponse response, HttpSession session) throws Exception {
return true;
}
}