ActionResponse.sendRedirect is not working in Spring Portlet liferay?

640 Views Asked by At

I am using spring portlet version ( 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 ?

1

There are 1 best solutions below

0
Olaf Kock On

Check Liferay's limited redirect configuration, configure accordingly and retry.

From that link, including the default values and documentation:

Set this property to "ip" or "domain" for the redirect security method. If set to "domain", the portal will only redirect users to domains listed in the property "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". 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. Input a blank list to allow any IP. SERVER_IP will be replaced with the IP of the host server. Defaults:

redirect.url.ips.allowed=127.0.0.1,SERVER_IP