| ClearRenderParametersAction.java |
1 /**
2 * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3 *
4 * The contents of this file are subject to the terms of the Liferay Enterprise
5 * Subscription License ("License"). You may not use this file except in
6 * compliance with the License. You can obtain a copy of the License by
7 * contacting Liferay, Inc. See the License for the specific language governing
8 * permissions and limitations under the License, including but not limited to
9 * distribution rights of the Software.
10 *
11 *
12 *
13 */
14
15 package com.liferay.portal.events;
16
17 import com.liferay.portal.kernel.events.Action;
18 import com.liferay.portal.util.WebKeys;
19
20 import java.util.Map;
21
22 import javax.servlet.http.HttpServletRequest;
23 import javax.servlet.http.HttpServletResponse;
24 import javax.servlet.http.HttpSession;
25
26 /**
27 * <a href="ClearRenderParametersAction.java.html"><b><i>View Source</i></b></a>
28 *
29 * @author Brian Wing Shun Chan
30 */
31 public class ClearRenderParametersAction extends Action {
32
33 public void run(HttpServletRequest request, HttpServletResponse response) {
34
35 // Some users are confused by the behavior stated in the JSR 168 spec
36 // that render parameters are saved across requests. Set this class to
37 // always clear render parameters to please those users. You can also
38 // modify the "layout.remember.request.window.state.maximized" property
39 // in portal.properties to disable the remembering of window states
40 // across requests.
41
42 HttpSession session = request.getSession();
43
44 Map<Long, Map<String, Map<String, String[]>>> renderParametersPool =
45 (Map<Long, Map<String, Map<String, String[]>>>)session.getAttribute(
46 WebKeys.PORTLET_RENDER_PARAMETERS);
47
48 if (renderParametersPool != null) {
49 renderParametersPool.clear();
50 }
51 }
52
53 }