01: /*
02: * Copyright 2005-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
05: * in compliance with the License. You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * Unless required by applicable law or agreed to in writing, software distributed under the License
10: * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11: * or implied. See the License for the specific language governing permissions and limitations under
12: * the License.
13: */
14:
15: package org.strecks.actiontest.actions;
16:
17: import java.sql.Date;
18:
19: import org.strecks.action.NavigableSubmitAction;
20: import org.strecks.action.navigable.NavigableLookupDispatchController;
21: import org.strecks.controller.annotation.Controller;
22: import org.strecks.injection.annotation.InjectRedirectHelper;
23: import org.strecks.navigate.annotation.NavigateForward;
24: import org.strecks.navigate.handler.ActionRedirectNavigationHandler;
25: import org.strecks.web.RedirectHelper;
26:
27: /**
28: * @author Phil Zoio
29: */
30: @Controller(name=NavigableLookupDispatchController.class)
31: public class SimpleNavigableSubmitAction implements
32: NavigableSubmitAction {
33:
34: private String message;
35:
36: private RedirectHelper helper;
37:
38: public void preBind() {
39: }
40:
41: public void execute() {
42: message = "Ran execute() method "
43: + SimpleNavigableSubmitAction.class;
44: helper.setStatusMessage(message);
45: helper.addRequestParameter("executeParam", 100);
46: }
47:
48: public void cancel() {
49: message = "Ran cancel() method "
50: + SimpleNavigableSubmitAction.class;
51: helper.setStatusMessage(message);
52: helper.addRequestParameter("cancelParam", new Date(System
53: .currentTimeMillis()).toString());
54: }
55:
56: @NavigateForward(handler=ActionRedirectNavigationHandler.class)
57: public String nextAction() {
58: return "post_redirect_action";
59: }
60:
61: @InjectRedirectHelper
62: public void setHelper(RedirectHelper helper) {
63: this.helper = helper;
64: }
65:
66: }
|