KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > struts > webapp > example > ApplicationMapping


1 /*
2  * $Id: ApplicationMapping.java 54929 2004-10-16 16:38:42Z germuska $
3  *
4  * Copyright 1999-2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19
20 package org.apache.struts.webapp.example;
21
22
23 import org.apache.struts.action.ActionMapping;
24
25
26 /**
27  * Implementation of <strong>ActionMapping</strong> for the Struts
28  * example application. It defines the following custom properties:
29  * <ul>
30  * <li><b>failure</b> - The context-relative URI to which this request
31  * should be forwarded if a validation error occurs on the input
32  * information (typically goes back to the input form).
33  * <li><b>success</b> - The context-relative URI to which this request
34  * should be forwarded if the requested action is successfully
35  * completed.
36  * </ul>
37  *
38  * @version $Rev: 54929 $ $Date: 2004-10-16 17:38:42 +0100 (Sat, 16 Oct 2004) $
39  */

40
41 public final class ApplicationMapping extends ActionMapping {
42
43
44     // --------------------------------------------------- Instance Variables
45

46
47     /**
48      * The failure URI for this mapping.
49      */

50     private String JavaDoc failure = null;
51
52
53     /**
54      * The success URI for this mapping.
55      */

56     private String JavaDoc success = null;
57
58
59     // ----------------------------------------------------------- Properties
60

61
62     /**
63      * Return the failure URI for this mapping.
64      */

65     public String JavaDoc getFailure() {
66
67     return (this.failure);
68
69     }
70
71
72     /**
73      * Set the failure URI for this mapping.
74      *
75      * @param failure The failure URI for this mapping
76      */

77     public void setFailure(String JavaDoc failure) {
78
79     this.failure = failure;
80
81     }
82
83
84     /**
85      * Return the success URI for this mapping.
86      */

87     public String JavaDoc getSuccess() {
88
89     return (this.success);
90
91     }
92
93
94     /**
95      * Set the success URI for this mapping.
96      *
97      * @param success The success URI for this mapping
98      */

99     public void setSuccess(String JavaDoc success) {
100
101     this.success = success;
102
103     }
104
105
106 }
107
Popular Tags