001: /*
002: * Copyright 2005-2006 the original author or authors.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
005: * in compliance with the License. You may obtain a copy of the License at
006: *
007: * http://www.apache.org/licenses/LICENSE-2.0
008: *
009: * Unless required by applicable law or agreed to in writing, software distributed under the License
010: * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
011: * or implied. See the License for the specific language governing permissions and limitations under
012: * the License.
013: */
014:
015: package org.strecks.injection.handler.impl;
016:
017: import javax.servlet.http.HttpServletRequest;
018: import javax.servlet.http.HttpServletResponse;
019:
020: import org.apache.struts.action.Action;
021: import org.apache.struts.action.ActionForm;
022: import org.apache.struts.action.ActionForward;
023: import org.apache.struts.action.ActionMapping;
024: import org.strecks.injection.annotation.InjectContextAttribute;
025: import org.strecks.injection.annotation.InjectRedirectParameter;
026: import org.strecks.injection.annotation.InjectRequestAttribute;
027: import org.strecks.injection.annotation.InjectRequestParameter;
028: import org.strecks.injection.annotation.InjectScopedAttribute;
029: import org.strecks.injection.annotation.InjectSessionAttribute;
030:
031: /**
032: * @author Phil Zoio
033: */
034: public class RequestSessionAction extends Action {
035:
036: private Integer integerInput;
037:
038: private Integer requestAttribute;
039:
040: private Integer sessionAttribute;
041:
042: private Integer requiredSessionAttribute;
043:
044: private Integer requiredAutoCreateSessionAttribute;
045:
046: private Integer contextAttribute;
047:
048: private Integer redirectParameter;
049:
050: private QueryResults autoCreateSession;
051:
052: private QueryResults nonAutoCreateSession;
053:
054: private QueryResults autoCreateRequest;
055:
056: private QueryResults nonAutoCreateRequest;
057:
058: public Integer getIntegerInput() {
059: return integerInput;
060: }
061:
062: @InjectRequestParameter()
063: @InjectScopedAttribute(name="integer.Input")
064: public void setIntegerInput(Integer integerInput) {
065: this .integerInput = integerInput;
066: }
067:
068: public Integer getRequestAttribute() {
069: return requestAttribute;
070: }
071:
072: @InjectRequestAttribute()
073: public void setRequestAttribute(Integer requestAttribute) {
074: this .requestAttribute = requestAttribute;
075: }
076:
077: public Integer getSessionAttribute() {
078: return sessionAttribute;
079: }
080:
081: @InjectSessionAttribute(required=true)
082: public void setRequiredSessionAttribute(
083: Integer requiredSessionAttribute) {
084: this .requiredSessionAttribute = requiredSessionAttribute;
085: }
086:
087: public Integer getRequiredSessionAttribute() {
088: return requiredSessionAttribute;
089: }
090:
091: public Integer getRequiredAutoCreateSessionAttribute() {
092: return requiredAutoCreateSessionAttribute;
093: }
094:
095: @InjectSessionAttribute(required=true,autoCreate=true)
096: public void setRequiredAutoCreateSessionAttribute(
097: Integer requiredAutoCreateSessionAttribute) {
098: this .requiredAutoCreateSessionAttribute = requiredAutoCreateSessionAttribute;
099: }
100:
101: @InjectSessionAttribute()
102: public void setSessionAttribute(Integer sessionAttribute) {
103: this .sessionAttribute = sessionAttribute;
104: }
105:
106: public Integer getContextAttribute() {
107: return contextAttribute;
108: }
109:
110: @InjectContextAttribute()
111: public void setContextAttribute(Integer contextAttribute) {
112: this .contextAttribute = contextAttribute;
113: }
114:
115: public Integer getRedirectParameter() {
116: return redirectParameter;
117: }
118:
119: @InjectRedirectParameter(name="redirectParam")
120: public void setRedirectParameter(Integer redirectParameter) {
121: this .redirectParameter = redirectParameter;
122: }
123:
124: public QueryResults getAutoCreateSession() {
125: return autoCreateSession;
126: }
127:
128: @InjectSessionAttribute(name="autoCreateSession",autoCreate=true)
129: public void setAutoCreateSession(QueryResults autoCreate) {
130: this .autoCreateSession = autoCreate;
131: }
132:
133: public QueryResults getNonAutoCreateSession() {
134: return nonAutoCreateSession;
135: }
136:
137: @InjectSessionAttribute()
138: public void setNonAutoCreateSession(QueryResults nonAutoCreate) {
139: this .nonAutoCreateSession = nonAutoCreate;
140: }
141:
142: public QueryResults getAutoCreateRequest() {
143: return autoCreateRequest;
144: }
145:
146: @InjectRequestAttribute(name="autoCreateRequest",autoCreate=true)
147: public void setAutoCreateRequest(QueryResults autoCreateRequest) {
148: this .autoCreateRequest = autoCreateRequest;
149: }
150:
151: public QueryResults getNonAutoCreateRequest() {
152: return nonAutoCreateRequest;
153: }
154:
155: @InjectRequestAttribute()
156: public void setNonAutoCreateRequest(
157: QueryResults nonAutoCreateRequest) {
158: this .nonAutoCreateRequest = nonAutoCreateRequest;
159: }
160:
161: public void executeAction() {
162: throw new UnsupportedOperationException();
163: }
164:
165: public ActionForward execute() {
166: throw new UnsupportedOperationException();
167: }
168:
169: public Action clone() {
170:
171: return null;
172: }
173:
174: public void setEnvironment(ActionMapping mapping, ActionForm form,
175: HttpServletRequest request, HttpServletResponse response) {
176:
177: }
178:
179: public void preBind() {
180:
181: }
182:
183: public ActionForward cancel() {
184:
185: return null;
186: }
187:
188: public ActionForward handleRuntimeException(RuntimeException e) {
189:
190: return null;
191: }
192:
193: }
|