【问题标题】:ActionResponse.sendRedirect is not working in Spring Portlet liferay?ActionResponse.sendRedirect 在 Spring Portlet liferay 中不起作用?
【发布时间】:2018-09-11 01:03:35
【问题描述】:

我使用的是 spring portlet 版本(spring 4.1)。

@ActionMapping(param="action=redirectTest")
 public void handleRenderRequest(ActionRequest request,ActionResponse response,Model model){
  System.out.printIn("the value coming");
  response.sendRedirect("https://www.google.com");
  System.out.printIn("the value coming");
 }

sendRedirect 不工作?

【问题讨论】:

    标签: spring liferay spring-portlet-mvc


    【解决方案1】:

    检查 Liferay 的limited redirect 配置,进行相应配置并重试。

    来自该链接,包括默认值和文档:

    将此属性设置为“ip”或“域”以实现重定向安全性 方法。如果设置为“域”,门户只会将用户重定向到 属性“redirect.url.domain.allowed”中列出的域。如果设置 到“ip”,门户将仅重定向到其 IP 地址的域 解析为属性中列出的 IP 地址 “redirect.url.ip.allowed”。默认值:

    redirect.url.security.mode=ip
    

    例子:

    redirect.url.security.mode=domain
    

    输入允许门户访问的逗号分隔域列表 重定向到。输入一个空白列表以允许任何域。指定一个 带有前导“*.”的域允许重定向到子域。默认值:

    redirect.url.domains.allowed=
    

    输入允许门户访问的逗号分隔 IP 列表 重定向到。输入一个空白列表以允许任何 IP。 SERVER_IP 将是 替换为主机服务器的IP。默认值:

    redirect.url.ips.allowed=127.0.0.1,SERVER_IP
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-10-28
      • 1970-01-01
      • 1970-01-01
      • 2012-10-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多