2

我正在使用 Liferay 门户 6.0。版本。我正在创建钩子插件,以便在用户请求时重定向到新社区。我在 ServicePreAction 中重写了 run 方法,如下所示:

protected void doRun(HttpServletRequest request, HttpServletResponse response)
            throws Exception {

    ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(
          WebKeys.THEME_DISPLAY); 

    if(some condition) {
        response.sendRedirect("/web/mycommunity/home");
    }
} 

但我收到“重定向太多”错误。有什么解决办法吗?

4

0 回答 0