KickJava   Java API By Example, From Geeks To Geeks.

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


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 output form has been added to a 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  * Output forms may not be used on redirect forwards.
26  *
27  * @see Forward#addOutputForm
28  */

29 public class IllegalRedirectOutputFormException extends IllegalOutputFormException
30 {
31     /**
32      * @param forwardName the name of the relevant {@link Forward}.
33      * @param actionName the name of the current action being run.
34      * @param flowController the current {@link FlowController} instance.
35      * @param outputFormType the type name of the relevant output form.
36      */

37     public IllegalRedirectOutputFormException( String JavaDoc forwardName, String JavaDoc actionName, FlowController flowController,
38                                                String JavaDoc outputFormType )
39     {
40         super( forwardName, actionName, flowController, outputFormType );
41     }
42
43     protected Object JavaDoc[] getMessageArgs()
44     {
45         return new Object JavaDoc[]{ getForwardName(), getActionName(), getFlowControllerURI(), getOutputFormType() };
46     }
47
48     public String JavaDoc[] getMessageParts()
49     {
50         return new String JavaDoc[]
51         {
52             "The forward \"", "\" on action ", " in page flow ", " has at least one output form (type ",
53             "), but is set to redirect=\"true\". Output forms may not be used on redirect forwards."
54         };
55     }
56 }
57
Popular Tags