1
14
15 package com.liferay.portlet;
16
17 import javax.portlet.ActionResponse;
18 import javax.portlet.PortletRequest;
19
20
25 public class ActionResponseImpl
26 extends StateAwareResponseImpl implements ActionResponse {
27
28 public String getLifecycle() {
29 return PortletRequest.ACTION_PHASE;
30 }
31
32 public void sendRedirect(String location) {
33 if ((location == null) ||
34 (!location.startsWith("/") && (location.indexOf("://") == -1) &&
35 (!location.startsWith("wsrp_rewrite?")))) {
36
37 throw new IllegalArgumentException(
38 location + " is not a valid redirect");
39 }
40
41
44 if (location.startsWith("wsrp_rewrite?")) {
45 location = "http://wsrp-rewrite-holder?" + location;
46 }
47
48 if (isCalledSetRenderParameter()) {
49 throw new IllegalStateException(
50 "Set render parameter has already been called");
51 }
52
53 setRedirectLocation(location);
54 }
55
56 public void sendRedirect(String location, String renderUrlParamName) {
57 }
58
59 }