View Javadoc
1   /*
2    * $Id$
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$ $Date$
43   */
44  
45  public final class ApplicationMapping extends ActionMapping {
46      private static final long serialVersionUID = 4808460865738365608L;
47  
48  
49      // --------------------------------------------------- Instance Variables
50  
51  
52      /**
53       * The failure URI for this mapping.
54       */
55      private String failure = null;
56  
57  
58      /**
59       * The success URI for this mapping.
60       */
61      private String success = null;
62  
63  
64      // ----------------------------------------------------------- Properties
65  
66  
67      /**
68       * Return the failure URI for this mapping.
69       */
70      public String getFailure() {
71  
72      return (this.failure);
73  
74      }
75  
76  
77      /**
78       * Set the failure URI for this mapping.
79       *
80       * @param failure The failure URI for this mapping
81       */
82      public void setFailure(String failure) {
83  
84      this.failure = failure;
85  
86      }
87  
88  
89      /**
90       * Return the success URI for this mapping.
91       */
92      public String getSuccess() {
93  
94      return (this.success);
95  
96      }
97  
98  
99      /**
100      * Set the success URI for this mapping.
101      *
102      * @param success The success URI for this mapping
103      */
104     public void setSuccess(String success) {
105 
106     this.success = success;
107 
108     }
109 
110 
111 }