KickJava   Java API By Example, From Geeks To Geeks.

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


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 the user tries to execute an action that does not exist on the page flow.
23  */

24 public class ActionNotFoundException extends PageFlowException
25 {
26     private Object JavaDoc _form;
27     
28     
29     public ActionNotFoundException( String JavaDoc actionName, FlowController fc, Object JavaDoc form )
30     {
31         super( actionName, fc );
32         _form = form;
33     }
34
35     protected Object JavaDoc[] getMessageArgs()
36     {
37         return new Object JavaDoc[]{ getActionName(), getFlowControllerURI(), _form != null ? _form.getClass().getName() : null };
38     }
39
40     protected String JavaDoc[] getMessageParts()
41     {
42         String JavaDoc formDescrip = _form != null ? "(form " + _form.getClass().getName() + ") " : "";
43         return new String JavaDoc[]{ "Unable to find action ", " (form=", ") in Page Flow ", "." };
44     }
45     
46     protected Object JavaDoc getForm()
47     {
48         return _form;
49     }
50
51     /**
52      * Tell whether the root cause may be session expiration in cases where the requested session ID is different than
53      * the actual session ID. In this case, the answer is <code>false</code>.
54      */

55     public boolean causeMayBeSessionExpiration()
56     {
57         return false;
58     }
59 }
60
Popular Tags