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.util.Date;
18:
19: import org.strecks.action.BasicAction;
20: import org.strecks.action.basic.BasicController;
21: import org.strecks.constants.InfrastructureKeys;
22: import org.strecks.controller.annotation.Controller;
23: import org.strecks.converter.SQLDateConverter;
24: import org.strecks.injection.annotation.InjectRedirectParameter;
25: import org.strecks.injection.annotation.InjectRequestParameter;
26:
27: /**
28: * @author Phil Zoio
29: */
30: @Controller(name=BasicController.class)
31: public class PostRedirectAction implements BasicAction {
32:
33: private String message;
34:
35: private Date cancelParam;
36:
37: private int executeParam;
38:
39: public String execute() {
40: return "success";
41: }
42:
43: @InjectRedirectParameter(name=InfrastructureKeys.STATUS_MESSAGE)
44: public void setMessage(String message) {
45: this .message = message;
46: }
47:
48: @InjectRequestParameter
49: public void setExecuteParam(int executeParam) {
50: this .executeParam = executeParam;
51: }
52:
53: @InjectRequestParameter(converter=SQLDateConverter.class)
54: public void setCancelParam(Date cancelParam) {
55: this .cancelParam = cancelParam;
56: }
57:
58: public String getMessage() {
59: return message + " cancel param: " + cancelParam
60: + " execute param: " + executeParam;
61: }
62:
63: }
|