简体   繁体   English

ActionResponse.sendRedirect在Spring Portlet liferay中不起作用?

[英]ActionResponse.sendRedirect is not working in Spring Portlet liferay?

I am using spring portlet version ( spring 4.1). 我正在使用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");
 }

the sendRedirect is not working ? sendRedirect无法正常工作?

Check Liferay's limited redirect configuration, configure accordingly and retry. 检查Liferay的受限重定向配置,进行相应配置,然后重试。

From that link, including the default values and documentation: 通过该链接,包括默认值和文档:

Set this property to "ip" or "domain" for the redirect security method. 对于重定向安全性方法,将此属性设置为“ ip”或“ domain”。 If set to "domain", the portal will only redirect users to domains listed in the property "redirect.url.domain.allowed". 如果设置为“ domain”,门户将仅将用户重定向到属性“ redirect.url.domain.allowed”中列出的域。 If set to "ip", the portal will only redirect to domains whose IP address resolve to an IP address listed in the property "redirect.url.ip.allowed". 如果设置为“ ip”,则门户将仅重定向到其IP地址解析为属性“ redirect.url.ip.allowed”中列出的IP地址的域。 Defaults: 默认值:

 redirect.url.security.mode=ip 

Examples: 例子:

 redirect.url.security.mode=domain 

Input a list of comma delimited domains which the portal is allowed to redirect to. 输入允许门户重定向到的以逗号分隔的域的列表。 Input a blank list to allow any domain. 输入空白列表以允许任何域。 Specifying a domain with a leading "*." 用前导“ *”指定域。 allows redirects to subdomains. 允许重定向到子域。 Defaults: 默认值:

 redirect.url.domains.allowed= 

Input a list of comma delimited IPs which the portal is allowed to redirect to. 输入允许门户重定向到的以逗号分隔的IP列表。 Input a blank list to allow any IP. 输入一个空白列表以允许任何IP。 SERVER_IP will be replaced with the IP of the host server. SERVER_IP将替换为主机服务器的IP。 Defaults: 默认值:

 redirect.url.ips.allowed=127.0.0.1,SERVER_IP 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM