01: /*
02: * Copyright (c) 2002-2006 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.webwork.portlet.dispatcher;
06:
07: import com.opensymphony.xwork.Action;
08:
09: /**
10: * When a portlet is targetted for an <code>event</code>, the portlet will receive two
11: * portlet requests, one for the <code>event</code> phase, and then followed by a <code>render</code>
12: * operation. When in the <code>event</code> phase, the action that is executed can't render
13: * any output. This means that if an action in the XWork configuration is executed in the event
14: * phase, and the action is set up with a result that should render something, the result can't
15: * immediately be executed. The portlet needs to "wait" to the render phase to do the
16: * rendering.
17: *
18: * When the {@link com.opensymphony.webwork.portlet.result.PortletResult} detects such a
19: * scenario, instead of executing the actual view, it prepares a couple of render parameters
20: * specifying this action and the location of the view, which then will be executed in the
21: * following render request.
22: *
23: * @author Nils-Helge Garli
24: */
25: public class DirectRenderFromEventAction implements Action {
26:
27: private String location = null;
28:
29: /**
30: * Get the location of the view.
31: *
32: * @return Returns the location.
33: */
34: public String getLocation() {
35: return location;
36: }
37:
38: /**
39: * Set the location of the view.
40: *
41: * @param location The location to set.
42: */
43: public void setLocation(String location) {
44: this .location = location;
45: }
46:
47: /**
48: * @see com.opensymphony.xwork.Action#execute()
49: */
50: public String execute() throws Exception {
51: return SUCCESS;
52: }
53: }
|