View Javadoc

1   /*
2    * $Id: ApplicationMapping.java 471754 2006-11-06 14:55:09Z husted $
3    *
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  
23  package org.apache.struts.webapp.example;
24  
25  
26  import org.apache.struts.action.ActionMapping;
27  
28  
29  /**
30   * Implementation of <strong>ActionMapping</strong> for the Struts
31   * example application.  It defines the following custom properties:
32   * <ul>
33   * <li><b>failure</b> - The context-relative URI to which this request
34   *     should be forwarded if a validation error occurs on the input
35   *     information (typically goes back to the input form).
36   * <li><b>success</b> - The context-relative URI to which this request
37   *     should be forwarded if the requested action is successfully
38   *     completed.
39   * </ul>
40   *
41   * @author Craig R. McClanahan
42   * @version $Rev: 471754 $ $Date: 2006-11-06 08:55:09 -0600 (Mon, 06 Nov 2006) $
43   */
44  
45  public final class ApplicationMapping extends ActionMapping {
46  
47  
48      // --------------------------------------------------- Instance Variables
49  
50  
51      /**
52       * The failure URI for this mapping.
53       */
54      private String failure = null;
55  
56  
57      /**
58       * The success URI for this mapping.
59       */
60      private String success = null;
61  
62  
63      // ----------------------------------------------------------- Properties
64  
65  
66      /**
67       * Return the failure URI for this mapping.
68       */
69      public String getFailure() {
70  
71      return (this.failure);
72  
73      }
74  
75  
76      /**
77       * Set the failure URI for this mapping.
78       *
79       * @param failure The failure URI for this mapping
80       */
81      public void setFailure(String failure) {
82  
83      this.failure = failure;
84  
85      }
86  
87  
88      /**
89       * Return the success URI for this mapping.
90       */
91      public String getSuccess() {
92  
93      return (this.success);
94  
95      }
96  
97  
98      /**
99       * Set the success URI for this mapping.
100      *
101      * @param success The success URI for this mapping
102      */
103     public void setSuccess(String success) {
104 
105     this.success = success;
106 
107     }
108 
109 
110 }