KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > pageflow > IllegalActionOutputException


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

18 package org.apache.beehive.netui.pageflow;
19
20
21 /**
22  * Exception that occurs when an action output has been added to a {@link Forward} that resolves to a
23  * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward} annotation marked with
24  * <code>{@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward#redirect redirect}=true</code>.
25  * Action outputs may not be used on redirect forwards.
26  */

27 public class IllegalActionOutputException extends PageFlowException
28 {
29     private String JavaDoc _forwardName;
30     private String JavaDoc _actionOutputName;
31
32     
33     /**
34      * Constructor.
35      *
36      * @param forwardName the name of the relevant {@link Forward}.
37      * @param actionName the name of the current action being run.
38      * @param flowController the current {@link FlowController} instance.
39      * @param actionOutputName the name of the relevant action output.
40      */

41     public IllegalActionOutputException( String JavaDoc forwardName, String JavaDoc actionName, FlowController flowController,
42                                          String JavaDoc actionOutputName )
43     {
44         super( actionName, flowController );
45         _forwardName = forwardName;
46         _actionOutputName = actionOutputName;
47     }
48
49     /**
50      * Get the name of the relevant {@link Forward}.
51      *
52      * @return a String that is the name of the relevant {@link Forward}.
53      */

54     public String JavaDoc getForwardName()
55     {
56         return _forwardName;
57     }
58
59     /**
60      * Set the name of the relevant {@link Forward}.
61      *
62      * @param forwardName a String that is the name of the relevant {@link Forward}.
63      */

64     public void setForwardName( String JavaDoc forwardName )
65     {
66         _forwardName = forwardName;
67     }
68
69     /**
70      * Get the name of the relevant action output.
71      *
72      * @return a String that is the name of the relevant action output.
73      */

74     public String JavaDoc getActionOutputName()
75     {
76         return _actionOutputName;
77     }
78
79     /**
80      * Set the name of the relevant action output.
81      *
82      * @param actionOutputName a String that is the name of the relevant action output.
83      */

84     public void setActionOutputName( String JavaDoc actionOutputName )
85     {
86         _actionOutputName = actionOutputName;
87     }
88
89     protected Object JavaDoc[] getMessageArgs()
90     {
91         return new Object JavaDoc[]{ _forwardName, getActionName(), getFlowControllerURI(), _actionOutputName };
92     }
93
94     public String JavaDoc[] getMessageParts()
95     {
96         return new String JavaDoc[]
97         {
98             "The forward \"", "\" on action ", " in page flow ", " has at least one action output (\"",
99             "\"), but is set to redirect=\"true\". Action outputs may not be used on redirect forwards."
100         };
101     }
102
103     /**
104      * Tell whether the root cause may be session expiration in cases where the requested session ID is different than
105      * the actual session ID. In this case, the answer is <code>false</code>.
106      */

107     public boolean causeMayBeSessionExpiration()
108     {
109         return false;
110     }
111 }
112
Popular Tags