01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: * $Header:$
18: */
19: package org.apache.beehive.netui.pageflow;
20:
21: import org.apache.beehive.netui.util.Bundle;
22:
23: /**
24: * Exception that occurs when the current action method does not accept the type of form bean passed in the
25: * {@link Forward} to the action. This may happen when control is returned from a nested page flow, with a specified
26: * form bean type
27: * (<code>outputFormBean</code> or <code>outputFormBeanType</code> set on
28: * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward},
29: * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction @Jpf.SimpleAction}, or
30: * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.ConditionalForward @Jpf.ConditionalForward})
31: * but no action in the calling page flow accepts that form bean type.
32: */
33: public class NoMatchingActionMethodException extends PageFlowException {
34: private String _formClassName;
35:
36: public NoMatchingActionMethodException(String actionName,
37: Object form, FlowController fc) {
38: super (actionName, fc);
39: _formClassName = form != null ? form.getClass().getName()
40: : Bundle.getString("PageFlow_NoFormString");
41: }
42:
43: public String getFormClassName() {
44: return _formClassName;
45: }
46:
47: protected Object[] getMessageArgs() {
48: return new Object[] { getActionName(), _formClassName,
49: getFlowControllerURI() };
50: }
51:
52: protected String[] getMessageParts() {
53: return new String[] {
54: "Could not find matching action method for action=",
55: ", form=", " on Page Flow ", "." };
56: }
57:
58: /**
59: * Tell whether the root cause may be session expiration in cases where the requested session ID is different than
60: * the actual session ID. In this case, the answer is <code>false</code>.
61: */
62: public boolean causeMayBeSessionExpiration() {
63: return false;
64: }
65: }
|