You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ri...@apache.org on 2005/05/15 07:29:30 UTC
svn commit: r170197 [2/3] - in /incubator/beehive/trunk/netui/src:
compiler-core/org/apache/beehive/netui/compiler/grammar/
pageflow/org/apache/beehive/netui/pageflow/
pageflow/org/apache/beehive/netui/pageflow/config/
pageflow/org/apache/beehive/netui/pageflow/faces/
pageflow/org/apache/beehive/netui/pageflow/faces/internal/
pageflow/org/apache/beehive/netui/pageflow/handler/
pageflow/org/apache/beehive/netui/pageflow/interceptor/
pageflow/org/apache/beehive/netui/pageflow/interceptor/action/
pageflow/org/apache/beehive/netui/pageflow/interceptor/request/
pageflow/org/apache/beehive/netui/pageflow/internal/
pageflow/org/apache/beehive/netui/pageflow/validation/
pageflow/org/apache/beehive/netui/pageflow/xmlhttprequest/
scoping/org/apache/beehive/netui/pageflow/scoping/internal/
tags-databinding/org/apache/beehive/netui/tags/databinding/pageinput/
tags-html/org/apache/beehive/netui/tags/html/
tomcat-server/5x/org/apache/beehive/netui/tomcat/
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalActionOutputException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalActionOutputException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalActionOutputException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalActionOutputException.java Sat May 14 22:29:26 2005
@@ -19,9 +19,10 @@
/**
- * Exception that occurs when an action output has been added to a Forward that resolves to a
- * <code>@jpf:forward</code> marked <code>redirect="true"</code>. Action outputs may not be used on
- * redirect forwards.
+ * Exception that occurs when an action output has been added to a {@link Forward} that resolves to a
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward} annotation marked with
+ * <code>{@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward#redirect redirect}=true</code>.
+ * Action outputs may not be used on redirect forwards.
*/
public class IllegalActionOutputException extends PageFlowException
{
@@ -99,6 +100,10 @@
};
}
+ /**
+ * Tell whether the root cause may be session expiration in cases where the requested session ID is different than
+ * the actual session ID. In this case, the answer is <code>false</code>.
+ */
public boolean causeMayBeSessionExpiration()
{
return false;
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalOutputFormException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalOutputFormException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalOutputFormException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalOutputFormException.java Sat May 14 22:29:26 2005
@@ -83,6 +83,10 @@
_outputFormType = outputFormType;
}
+ /**
+ * Tell whether the root cause may be session expiration in cases where the requested session ID is different than
+ * the actual session ID. In this case, the answer is <code>false</code>.
+ */
public boolean causeMayBeSessionExpiration()
{
return false;
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalOutputFormTypeException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalOutputFormTypeException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalOutputFormTypeException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalOutputFormTypeException.java Sat May 14 22:29:26 2005
@@ -19,8 +19,10 @@
/**
- * Exception that occurs when the first output form for a Forward resolves to a
- * <code>@jpf:forward</code> whose <code>return-form</code> or <code>return-form-type</code>
+ * Exception that occurs when the first output form for a {@link Forward} resolves to a
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward} annotation whose
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward#outputFormBean outputFormBean} or
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward#outputFormBeanType outputFormBeanType}
* attribute demands a different form type.
*
* @see Forward#addOutputForm
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalPageInputException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalPageInputException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalPageInputException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalPageInputException.java Sat May 14 22:29:26 2005
@@ -20,8 +20,9 @@
/**
* Exception that occurs when a action output has been added to a Forward that resolves to a
- * <code>@jpf:forward</code> marked <code>redirect="true"</code>. Action outputs may not be used on
- * redirect forwards.
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward} annotation marked with
+ * <code>{@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward#redirect redirect}=true</code>.
+ * Action outputs may not be used on redirect forwards.
*
* @deprecated Use {@link IllegalActionOutputException} instead.
*/
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalRedirectOutputFormException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalRedirectOutputFormException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalRedirectOutputFormException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalRedirectOutputFormException.java Sat May 14 22:29:26 2005
@@ -20,8 +20,9 @@
/**
* Exception that occurs when an output form has been added to a Forward that resolves to a
- * <code>@jpf:forward</code> marked <code>redirect="true"</code>. Output forms may not be used on
- * redirect forwards.
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward} annotation marked with
+ * <code>{@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward#redirect redirect}=true</code>.
+ * Output forms may not be used on redirect forwards.
*
* @see Forward#addOutputForm
*/
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/InfiniteReturnToActionException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/InfiniteReturnToActionException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/InfiniteReturnToActionException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/InfiniteReturnToActionException.java Sat May 14 22:29:26 2005
@@ -19,9 +19,12 @@
/**
- * Exception that occurs when the user invokes an action that is qualified with a
- * <code>@jpf:forward return-to="previousAction"</code> annotation, but the previous action
- * was the same as the current action (an infinite loop).
+ * Exception that occurs when the
+ * <code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousAction previousAction}</code>
+ * attribute is used on a {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward}, a
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction @Jpf.SimpleAction}, or a
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.ConditionalForward @Jpf.ConditionalForward},
+ * but the previous action was the same as the current action (an infinite loop).
*/
public class InfiniteReturnToActionException extends PageFlowException
{
@@ -45,6 +48,10 @@
};
}
+ /**
+ * Tell whether the root cause may be session expiration in cases where the requested session ID is different than
+ * the actual session ID. In this case, the answer is <code>false</code>.
+ */
public boolean causeMayBeSessionExpiration()
{
return false;
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MismatchedActionOutputException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MismatchedActionOutputException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MismatchedActionOutputException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MismatchedActionOutputException.java Sat May 14 22:29:26 2005
@@ -70,6 +70,10 @@
return _actualType;
}
+ /**
+ * Tell whether the root cause may be session expiration in cases where the requested session ID is different than
+ * the actual session ID. In this case, the answer is <code>false</code>.
+ */
public boolean causeMayBeSessionExpiration()
{
return false;
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MissingActionOutputException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MissingActionOutputException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MissingActionOutputException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MissingActionOutputException.java Sat May 14 22:29:26 2005
@@ -56,6 +56,10 @@
return _forwardName;
}
+ /**
+ * Tell whether the root cause may be session expiration in cases where the requested session ID is different than
+ * the actual session ID. In this case, the answer is <code>false</code>.
+ */
public boolean causeMayBeSessionExpiration()
{
return false;
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoCurrentPageFlowException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoCurrentPageFlowException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoCurrentPageFlowException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoCurrentPageFlowException.java Sat May 14 22:29:26 2005
@@ -21,10 +21,15 @@
/**
- * Action that occurs when the user invokes an action that is qualified with either a
- * <code>@jpf:forward return-to="previousAction"</code> or <code>return-to="previousPage"</code>,
- * but there is no current page flow. This happens in iterative development mode when you have
- * modified files and caused the web application to be redeployed, or when the session expires.
+ * Exception that occurs when the
+ * <code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousAction previousAction}</code>,
+ * <code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#currentPage currentPage}</code>, or
+ * <code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousPage previousPage}</code>
+ * attribute is used on a {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward}, a
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction @Jpf.SimpleAction}, or a
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.ConditionalForward @Jpf.ConditionalForward},
+ * but there is no current page flow. This may happen when the user session expires, or when the web application has
+ * been redeployed.
*/
public class NoCurrentPageFlowException extends ReturnToException
{
@@ -38,6 +43,10 @@
return new String[]{ "No current page flow for return-to=\"", "\" on action ", "." };
}
+ /**
+ * Tell whether the root cause may be session expiration in cases where the requested session ID is different than
+ * the actual session ID. In this case, the answer is <code>true</code>.
+ */
public boolean causeMayBeSessionExpiration()
{
return true;
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoMatchingActionMethodException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoMatchingActionMethodException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoMatchingActionMethodException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoMatchingActionMethodException.java Sat May 14 22:29:26 2005
@@ -21,11 +21,14 @@
/**
- * Exception that occurs when the current action method does not accept the type of form passed in the Forward
- * to the action. This may happen when the user returned to the calling page flow, from a nested page flow,
- * with a specified form (<code>@jpf:forward return-form="</code><i>form-name</i><code>"</code> or
- * <code>return-form-type="</code><i>form-type</i><code>"</code>, but no action in the calling page flow
- * accepts that form type.
+ * Exception that occurs when the current action method does not accept the type of form bean passed in the
+ * {@link Forward} to the action. This may happen when control is returned from a nested page flow, with a specified
+ * form bean type
+ * (<code>outputFormBean</code> or <code>outputFormBeanType</code> set on
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward},
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction @Jpf.SimpleAction}, or
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.ConditionalForward @Jpf.ConditionalForward})
+ * but no action in the calling page flow accepts that form bean type.
*/
public class NoMatchingActionMethodException extends PageFlowException
{
@@ -57,6 +60,10 @@
};
}
+ /**
+ * Tell whether the root cause may be session expiration in cases where the requested session ID is different than
+ * the actual session ID. In this case, the answer is <code>false</code>.
+ */
public boolean causeMayBeSessionExpiration()
{
return false;
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoPreviousActionException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoPreviousActionException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoPreviousActionException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoPreviousActionException.java Sat May 14 22:29:26 2005
@@ -21,10 +21,12 @@
/**
- * Exception that occurs when the user attempts to execute an action marked with the <code>@jpf:forward
- * return-to="previousAction"</code> annotation, but there is no previously-run action. For example,
- * this could happen if the <code>begin</code> action returns a <code>@jpf:forward</code> marked
- * <code>return-to="previousAction"</code>.
+ * Exception that occurs when the
+ * <code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousAction previousAction}</code>
+ * attribute is used on a {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward}, a
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction @Jpf.SimpleAction}, or a
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.ConditionalForward @Jpf.ConditionalForward},
+ * but thethere is no previously-run action in the page flow.
*/
public class NoPreviousActionException extends ReturnToException
{
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoPreviousPageException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoPreviousPageException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoPreviousPageException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoPreviousPageException.java Sat May 14 22:29:26 2005
@@ -21,10 +21,14 @@
/**
- * Exception that occurs when the user attempts to execute an action marked with the
- * <code>@jpf:forward return-to="previousPage"</code> annotation, but there is no previous page in
- * the current page flow. This could happen if the <code>begin</code> action returns a
- * <code>@jpf:forward marked return-to="currentPage"</code>.
+ * Exception that occurs when the
+ * <code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousPage previousPage}</code>
+ * or
+ * <code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#currentPage currentPage}</code>
+ * attribute is used on a {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward}, a
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction @Jpf.SimpleAction}, or a
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.ConditionalForward @Jpf.ConditionalForward},
+ * but there is no previously-shown page in the current page flow.
*/
public class NoPreviousPageException extends ReturnToException
{
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NotLoggedInException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NotLoggedInException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NotLoggedInException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NotLoggedInException.java Sat May 14 22:29:26 2005
@@ -24,10 +24,15 @@
/**
* Exception thrown when:
* <ul>
- * <li>An action method marked with <code>@jpf:action login-required="true"</code> is hit
- * when there is no logged-in user, or</li>
- * <li>An action method marked with <code>@jpf:action roles-allowed="</code><i>roles</i><code>"
- * </code> is hit when there is no logged-in user.</li>
+ * <li>
+ * An action ({@link org.apache.beehive.netui.pageflow.annotations.Jpf.Action @Jpf.Action}
+ * or {@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction @Jpf.SimpleAction})
+ * marked with <code>loginRequired=true</code> is hit when there is no logged-in user, or,
+ * </li>
+ * <li>
+ * An action marked with <code>rolesAllowed="</code><i>list of roles</i><code>"</code> is hit when there is
+ * no logged-in user.
+ * </li>
* </ul>
* If the requested session-ID is different than the current session-ID, the {@link LoginExpiredException}
* will be thrown instead of the <code>NotLoggedInException</code>.
@@ -59,6 +64,10 @@
response.sendError( HttpServletResponse.SC_BAD_REQUEST, getLocalizedMessage() );
}
+ /**
+ * Tell whether the root cause may be session expiration in cases where the requested session ID is different than
+ * the actual session ID. In this case, the answer is <code>true</code>.
+ */
public boolean causeMayBeSessionExpiration()
{
return true;
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowActionServlet.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowActionServlet.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowActionServlet.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowActionServlet.java Sat May 14 22:29:26 2005
@@ -47,9 +47,9 @@
* ActionServlet that dynamically registers modules based on naming/location conventions for Struts
* configuration files that are generated by the Page Flow compiler. These files are located in
* /WEB-INF/.pageflow-struts-generated, and are named jpf-struts-config-<i>module-name</i>.xml.
- * The user may specify additional {@link ModuleConfigLocator} classes in web.xml, using the
- * "moduleConfigLocators" init-parameter; this allows the user to define other patterns for
- * auto-registered Struts modules.
+ * For auto-registration of config files in other locations, the user may specify additional
+ * {@link ModuleConfigLocator} classes in /WEB-INF/beehive-netui-config.xml using the
+ * <code><module-config-locators></code> element.
*/
public class PageFlowActionServlet extends AutoRegisterActionServlet
{
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java Sat May 14 22:29:26 2005
@@ -20,7 +20,7 @@
import org.apache.beehive.netui.pageflow.internal.InternalConstants;
/**
- * Constants related to Page Flows.
+ * Constants related to Page Flow.
*/
public interface PageFlowConstants
{
@@ -142,6 +142,12 @@
*/
public static final String JPF_MODULE_CONFIG_GEN_DIR = PAGEFLOW_MODULE_CONFIG_GEN_DIR;
- // TODO v1: comment this
+ /**
+ * The name of an automatically-generated Forward that can be used from <i>any</i> Page Flow action, in situations
+ * where the framework can handle the response itself. Currently, this happens when a nested page flow returns
+ * after being shown in a popup window. In the calling page flow, the handler for the return action would return
+ * something like <code>new Forward("_auto")</code>, and the framework would write out the correct javascript to
+ * close the popup window.
+ */
public static final String AUTO_VIEW_RENDER_FORWARD_NAME = "_auto";
}
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowContextListener.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowContextListener.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowContextListener.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowContextListener.java Sat May 14 22:29:26 2005
@@ -17,9 +17,6 @@
*/
package org.apache.beehive.netui.pageflow;
-//java imports
-
-//internal imports
import org.apache.beehive.netui.core.urltemplates.URLTemplateDescriptor;
import org.apache.beehive.netui.pageflow.handler.Handlers;
import org.apache.beehive.netui.pageflow.internal.AdapterManager;
@@ -119,34 +116,47 @@
private static void initPrefixHandlers()
{
PrefixHandlers ph = ConfigUtil.getConfig().getPrefixHandlers();
- if (ph == null)
+ if ( ph == null )
+ {
return;
+ }
PrefixHandlers.PrefixHandler[] prefixHandlers = ph.getPrefixHandlerArray();
- if (prefixHandlers != null) {
- for (int i=0;i<prefixHandlers.length;i++) {
- try {
- Class prefixClass = Class.forName(prefixHandlers[i].getHandlerClass());
+ if ( prefixHandlers != null )
+ {
+ for ( int i = 0; i < prefixHandlers.length; i++ )
+ {
+ try
+ {
+ Class prefixClass = Class.forName( prefixHandlers[i].getHandlerClass() );
String name = prefixHandlers[i].getName();
- if (name == null || name.equals("")) {
- _log.warn("The name for the prefix handler '" + prefixHandlers[i].getHandlerClass() + "' must not be null");
+ if ( name == null || name.equals( "" ) )
+ {
+ _log.warn( "The name for the prefix handler '" + prefixHandlers[i].getHandlerClass()
+ + "' must not be null" );
continue;
}
Object o = prefixClass.newInstance();
- if (!(o instanceof RequestParameterHandler)) {
- _log.warn("The class '" + prefixHandlers[i].getHandlerClass() + "' must be an instance of RequestParameterHandler");
+ if ( !( o instanceof RequestParameterHandler ) )
+ {
+ _log.warn( "The class '" + prefixHandlers[i].getHandlerClass()
+ + "' must be an instance of RequestParameterHandler" );
continue;
}
- ProcessPopulate.registerPrefixHandler(name, (RequestParameterHandler) o);
+ ProcessPopulate.registerPrefixHandler( name, ( RequestParameterHandler ) o );
}
- catch (ClassNotFoundException e) {
- _log.warn("Class '" + prefixHandlers[i].getHandlerClass() + "' not found", e);
+ catch ( ClassNotFoundException e )
+ {
+ _log.warn( "Class '" + prefixHandlers[i].getHandlerClass() + "' not found", e );
}
- catch (IllegalAccessException e) {
- _log.warn("Illegal access on Class '" + prefixHandlers[i].getHandlerClass() + "'", e);
+ catch ( IllegalAccessException e )
+ {
+ _log.warn( "Illegal access on Class '" + prefixHandlers[i].getHandlerClass() + "'", e );
}
- catch (InstantiationException e) {
- _log.warn("InstantiationException on Class '" + prefixHandlers[i].getHandlerClass() + "'", e.getCause());
+ catch ( InstantiationException e )
+ {
+ _log.warn( "InstantiationException on Class '" + prefixHandlers[i].getHandlerClass() + "'",
+ e.getCause() );
}
}
}
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java Sat May 14 22:29:26 2005
@@ -47,22 +47,50 @@
/**
- * Base class for user-defined state and controller logic associated with a particular web
- * application directory. The source code for this class lives in the directory with a ".jpf"
- * extension, and is automatically recompiled by the server whenever necessary. When a request
- * arrives for any ".jpf", ".jsp", or ".do" in the directory, an instance of the PageFlowController
- * class is set as the <i>current page flow</i>, and remains in the session until a different
- * one becomes active.
* <p>
- * The user's PageFlowController class handles <i>actions</i> that are most commonly raised by
- * user interaction with JSP files. The actions are handled by <i>action methods</i> that
- * perform arbitrary logic and determine the next URI to be displayed.
+ * Base class for controller logic, exception handlers, and state associated with a particular web directory path.
+ * The class is configured through the
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller @Jpf.Controller} annotation.
+ * </p>
+ *
+ * <p>
+ * When a page flow request (the page flow URI itself, or any ".do" or page URI in the directory path), arrives, an
+ * instance of the associated PageFlowController class is set as the <i>current page flow</i>, and remains stored in the
+ * session until a different one becomes active ("long lived" page flows stay in the session indefinitely;
+ * see {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller#longLived longLived}
+ * on {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller @Jpf.Controller}).
+ * </p>
+ *
+ * <p>
+ * The page flow class handles <i>actions</i> that are most commonly raised by user interaction with pages. The actions
+ * are handled by <i>action methods</i> or <i>action annotations</i> that determine the next URI to be displayed, after
+ * optionally performing arbitrary logic.
+ * </p>
+ *
* <p>
- * Actions that are not handled by the current PageFlowController "bubble" up to the appropriate
- * {@link SharedFlowController} instance.
+ * If the PageFlowController is a "nested page flow"
+ * ({@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller#nested nested} is set to <code>true</code>
+ * on {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller @Jpf.Controller}), then this
+ * is a reusable, modular flow that can be "nested" during other flows. It has entry points (actions with optional form
+ * bean arguments), and exit points ({@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward},
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction @Jpf.SimpleAction}, or
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.ConditionalForward @Jpf.ConditionalForward} annotations
+ * that have <code>returnAction</code> attributes).
+ * </p>
+ *
+ * <p>
+ * The page flow class also handles exceptions thrown by actions or during page execution
+ * (see {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller#catches catches} on
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller @Jpf.Controller}). Unhandled exceptions are
+ * handled in order by declared {@link SharedFlowController}s
+ * (see {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller#sharedFlowRefs sharedFlowRefs} on
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller @Jpf.Controller}).
+ * </p>
+ *
* <p>
- * Data in the current PageFlowController instance can be accessed by databinding tags using the
- * <code>pageFlow</code> scope.
+ * Properties in the current page flow instance can be accessed from JSP 2.0-style expressions like this one:
+ * <code>${pageFlow.someProperty}</code>.
+ * </p>
*
* @see SharedFlowController
*/
@@ -125,8 +153,9 @@
/**
* Tell whether this PageFlowController can be "nested", i.e., if it can be invoked from another page
- * flow with the intention of returning to the original one. Page flows are declared to be nested
- * using the <code>@jpf:controller nested="true"</code> annotation.
+ * flow with the intention of returning to the original one. Page flows are declared to be nested by specifying
+ * <code>{@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller#nested nested}=true</code> on the
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller @Jpf.Controller} annotation.
*
* @return <code>true</code> if this PageFlowController can be nested.
*/
@@ -146,7 +175,7 @@
}
/**
- * Remove this instance from the session.
+ * Remove this instance from the session. When inside a page flow action, {@link #remove} may be called instead.
*/
protected synchronized void removeFromSession( HttpServletRequest request )
{
@@ -174,8 +203,8 @@
}
/**
- * This is a framework-invoked method to save the page flow instance in the session. It should not normally be
- * invoked directly.
+ * Store this object in the user session, in the appropriate place. Used by the framework; normally should not be
+ * called directly.
*/
public void persistInSession( HttpServletRequest request, HttpServletResponse response )
{
@@ -199,12 +228,13 @@
}
/**
- * Ensures that any changes to this FlowController will be replicated in a cluster (for failover),
+ * Ensures that any changes to this object will be replicated in a cluster (for failover),
* even if the replication scheme uses a change-detection algorithm that relies on
- * HttpSession.setAttribute to be aware of changes.
+ * HttpSession.setAttribute to be aware of changes. Note that this method is used by the framework
+ * and does not need to be called explicitly in most cases.
*
* @param request the current HttpServletRequest
- */
+ */
public void ensureFailover( HttpServletRequest request )
{
//
@@ -296,11 +326,15 @@
}
/**
- * Get a shared flow, based on its name as defined in this page flow's {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller#sharedFlowRefs}
- * annotation. To retrieve any shared flow based on its class name, use {@link PageFlowUtils#getSharedFlow}.
- *
- * @param sharedFlowName the name of the shared flow, as in this page flows's {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller#sharedFlowRefs()}
- * annotation.
+ * Get a shared flow, based on its name as defined in this page flow's
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller#sharedFlowRefs sharedFlowRefs}
+ * attribute on {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller @Jpf.Controller}.
+ * To retrieve any shared flow based on its class name, use {@link PageFlowUtils#getSharedFlow}.
+ *
+ * @param sharedFlowName the name of the shared flow, as in this page flows's
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller#sharedFlowRefs sharedFlowRefs}
+ * attribute on the {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller @Jpf.Controller}
+ * annotation.
* @return the {@link SharedFlowController} with the given name.
*/
public SharedFlowController getSharedFlow( String sharedFlowName )
@@ -310,11 +344,14 @@
/**
* Remove a shared flow from the session, based on its name as defined in this page flow's
- * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller#sharedFlowRefs} annotation. To remove any shared flow based on its class name, use
- * {@link PageFlowUtils#removeSharedFlow}.
- *
- * @param sharedFlowName the name of the shared flow, as in this page flows's {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller#sharedFlowRefs()}
- * annotation.
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller#sharedFlowRefs sharedFlowRefs}
+ * attribute on {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller @Jpf.Controller}.
+ * To remove any shared flow based on its class name, use {@link PageFlowUtils#removeSharedFlow}.
+ *
+ * @param sharedFlowName the name of the shared flow, as in this page flows's
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller#sharedFlowRefs sharedFlowRefs}
+ * attribute on the {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller @Jpf.Controller}
+ * annotation.
*/
public void removeSharedFlow( String sharedFlowName )
{
@@ -371,10 +408,11 @@
/**
* Get the submitted form bean from the most recent action execution in this PageFlowController.
* <p>
- * <i>Note: if the current page flow does not contain a </i>{@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward}<i> or a
- * </i>{@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction}<i> with a
- * </i><code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousAction}</code><i>
- * attribute, then this method will always return </i><code>null</code><i> by default. To enable it in this
+ * <i>Note: if the current page flow does not contain a
+ * </i>{@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward}<i> or a
+ * </i>{@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction @Jpf.SimpleAction}<i> with
+ * </i><code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousAction Jpf.NavigateTo.previousAction}</code><i>,
+ * then this method will always return </i><code>null</code><i> by default. To enable it in this
* situation, add the following method to the page flow:</i><br>
* <blockquote>
* <code>
@@ -405,9 +443,11 @@
/**
* Get the submitted form bean from the most recent action execution in this PageFlowController.
* <p>
- * <i>Note: if the current page flow does not contain a </i>{@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward}<i> or a
- * </i>{@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction}<i> with a </i><code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousAction}</code><i>
- * attribute, then this method will always return </i><code>null</code><i> by default. To enable it in this
+ * <i>Note: if the current page flow does not contain a
+ * </i>{@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward}<i> or a
+ * </i>{@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction @Jpf.SimpleAction}<i> with
+ * </i><code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousAction Jpf.NavigateTo.previousAction}</code><i>,
+ * then this method will always return </i><code>null</code><i> by default. To enable it in this
* situation, add the following method to the page flow:</i><br>
* <blockquote>
* <code>
@@ -436,10 +476,13 @@
/**
* Get the URI for the most recent action in this PageFlowController.
* <p>
- * <i>Note: if the current page flow does not use a </i><code>@jpf:forward</code><i> with a</i>
- * <code>return-to="previousAction"</code><i> attribute, then this method will always return
- * </i><code>null</code><i> by default. To enable it in this situation, add the following method
- * to the page flow:</i><br>
+ * <i>Note: if the current page flow does not use a
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward},
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction @Jpf.SimpleAction}, or
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.ConditionalForward @Jpf.ConditionalForward}
+ * with <code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousAction previousAction}</code>,
+ * then this method will always return </i><code>null</code><i> by default. To enable it in this situation, add the
+ * following method to the page flow:</i><br>
* <blockquote>
* <code>
* protected boolean alwaysTrackPreviousAction()<br>
@@ -466,10 +509,14 @@
/**
* Get the webapp-relative URI for the most recent page (in this page flow) shown to the user.
* <p>
- * <i>Note: if the current page flow does not use a </i><code>@jpf:forward</code><i> with a</i>
- * <code>return-to="previousPage"</code><i> or </i><code>return-to="currentPage"</code><i>
- * attribute, then this method will always return </i><code>null</code><i> by default. To enable
- * it in this situation, add the following method to the page flow:</i><br>
+ * <i>Note: if the current page flow does not use a
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward},
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction @Jpf.SimpleAction}, or
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.ConditionalForward @Jpf.ConditionalForward}
+ * with <code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#currentPage currentPage}</code>
+ * or <code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousPage previousPage}</code>,
+ * then this method will always return </i><code>null</code><i> by default. To enable it in this situation, add the
+ * following method to the page flow:</i><br>
* <blockquote>
* <code>
* protected boolean alwaysTrackPreviousPage()<br>
@@ -514,10 +561,14 @@
* Get the webapp-relative URI for the previous page (in this page flow) shown to the user.
* The previous page is the one shown before the most recent page.
* <p>
- * <i>Note: if the current page flow does not use a </i><code>@jpf:forward</code><i> with a</i>
- * <code>return-to="previousPage"</code><i> or </i><code>return-to="currentPage"</code><i>
- * attribute, then this method will always return </i><code>null</code><i> by default. To enable
- * it in this situation, add the following method to the page flow:</i><br>
+ * <i>Note: if the current page flow does not use a
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward},
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction @Jpf.SimpleAction}, or
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.ConditionalForward @Jpf.ConditionalForward}
+ * with <code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#currentPage currentPage}</code>
+ * or <code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousPage previousPage}</code>,
+ * then this method will always return </i><code>null</code><i> by default. To enable it in this situation, add the
+ * following method to the page flow:</i><br>
* <blockquote>
* <code>
* protected boolean alwaysTrackPreviousPage()<br>
@@ -569,10 +620,14 @@
/**
* Get information about the most recent page (in this page flow) shown to the user.
* <p>
- * <i>Note: if the current page flow does not use a </i><code>@jpf:forward</code><i> with a</i>
- * <code>return-to="previousPage"</code><i> or </i><code>return-to="currentPage"</code><i>
- * attribute, then this method will always return </i><code>null</code><i> by default. To enable
- * it in this situation, add the following method to the page flow:</i><br>
+ * <i>Note: if the current page flow does not use a
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward},
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction @Jpf.SimpleAction}, or
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.ConditionalForward @Jpf.ConditionalForward}
+ * with <code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#currentPage currentPage}</code>
+ * or <code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousPage previousPage}</code>,
+ * then this method will always return </i><code>null</code><i> by default. To enable it in this situation, add the
+ * following method to the page flow:</i><br>
* <blockquote>
* <code>
* protected boolean alwaysTrackPreviousPage()<br>
@@ -607,17 +662,14 @@
* Get information about the previous page (in this page flow) shown to the user. The previous
* page is the one shown before the most recent page.
* <p>
- * <i>Note: if the current page flow does not use a </i><code>@jpf:forward</code><i> with a</i>
- * <code>return-to="previousPage"</code><i> or </i><code>return-to="currentPage"</code><i>
- * attribute, then this method will always return </i><code>null</code><i> by default. To enable
- * it in this situation, add the following method to the page flow:</i><br>
- * <blockquote>
- * <code>
- * protected boolean alwaysTrackPreviousPage()<br>
- * {<br>
- * return true;<br>
- * }<br>
- * </code>
+ * <i>Note: if the current page flow does not use a
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward},
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction @Jpf.SimpleAction}, or
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.ConditionalForward @Jpf.ConditionalForward}
+ * with <code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#currentPage currentPage}</code>
+ * or <code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousPage previousPage}</code>,
+ * then this method will always return </i><code>null</code><i> by default. To enable it in this situation, add the
+ * following method to the page flow:</i><br>
* </blockquote>
*
* @return a PreviousPageInfo with information about the previous page shown to the user.
@@ -645,10 +697,13 @@
/**
* Get information about the most recent action run in this page flow.
* <p>
- * <i>Note: if the current page flow does not use a </i><code>@jpf:forward</code><i> with a</i>
- * <code>return-to="previousAction"</code><i> attribute, then this method will always return
- * </i><code>null</code><i> by default. To enable it in this situation, add the following method
- * to the page flow:</i><br>
+ * <i>Note: if the current page flow does not use a
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward},
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction @Jpf.SimpleAction}, or
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.ConditionalForward @Jpf.ConditionalForward}
+ * with <code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousAction previousAction}</code>,
+ * then this method will always return </i><code>null</code><i> by default. To enable it in this situation, add the
+ * following method to the page flow:</i><br>
* <blockquote>
* <code>
* protected boolean alwaysTrackPreviousAction()<br>
@@ -730,8 +785,8 @@
}
/**
- * Store information about recent pages displayed. Usually should not be called directly.
- * @exclude
+ * Store information about recent pages displayed. This is a framework-invoked method that should not normally be
+ * called directly.
*/
public void savePreviousPageInfo( ActionForward forward, ActionForm form, ActionMapping mapping,
HttpServletRequest request, ServletContext servletContext,
@@ -811,8 +866,8 @@
}
/**
- * Callback when this page flow is removed from the user session. Causes {@link #onDestroy}
- * to be called.
+ * Callback when this object is removed from the user session. Causes {@link #onDestroy} to be called. This is a
+ * framework-invoked method that should not normally be called indirectly.
*/
public void valueUnbound( HttpSessionBindingEvent event )
{
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowEventReporter.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowEventReporter.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowEventReporter.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowEventReporter.java Sat May 14 22:29:26 2005
@@ -26,6 +26,9 @@
import javax.servlet.ServletRequest;
+/**
+ * An event reporter, which will be notified of events like "page flow created", "action raised", etc.
+ */
public abstract class PageFlowEventReporter
{
private ServletContext _servletContext;
@@ -39,8 +42,8 @@
ServletRequest request, ServletResponse response );
public abstract void actionSuccess( FlowController flowController, ActionMapping mapping, ActionForm form,
- ServletRequest request, ServletResponse response,
- ActionForward result );
+ ServletRequest request, ServletResponse response, ActionForward result,
+ long timeTakenMillis );
public abstract void exceptionRaised( Throwable ex, ActionMapping actionMapping, ActionForm form,
FlowController flowController, ServletRequest request,
@@ -48,7 +51,8 @@
public abstract void exceptionHandled( Throwable ex, ActionMapping actionMapping, ActionForm form,
FlowController flowController, ServletRequest request,
- ServletResponse response, ActionForward result );
+ ServletResponse response, ActionForward result,
+ long timeTakenMillis );
public abstract void flowControllerCreated( FlowController flowController, ServletRequest request,
ServletResponse response );
@@ -57,11 +61,11 @@
public abstract void beginActionRequest( ServletRequest request, ServletResponse response );
- public abstract void endActionRequest( ServletRequest request, ServletResponse response );
+ public abstract void endActionRequest( ServletRequest request, ServletResponse response, long timeTakenMillis );
public abstract void beginPageRequest( ServletRequest request, ServletResponse response );
- public abstract void endPageRequest( ServletRequest request, ServletResponse response );
+ public abstract void endPageRequest( ServletRequest request, ServletResponse response, long timeTakenMillis );
protected ServletContext getServletContext()
{
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowException.java Sat May 14 22:29:26 2005
@@ -84,5 +84,10 @@
return _actionName;
}
+ /**
+ * Tell whether the root cause may be session expiration in cases where the requested session ID is different than
+ * the actual session ID; if <code>true</code>, then a {@link SessionExpiredException} will be thrown instead of
+ * this one in these situations.
+ */
public abstract boolean causeMayBeSessionExpiration();
}
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowFacesFilter.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowFacesFilter.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowFacesFilter.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowFacesFilter.java Sat May 14 22:29:26 2005
@@ -24,7 +24,7 @@
/**
- * Servlet Filter for JavaServerFaces requests.
+ * Servlet Filter for JavaServer Faces requests.
*/
public class PageFlowFacesFilter
extends PageFlowPageFilter
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowFileFilter.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowFileFilter.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowFileFilter.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowFileFilter.java Sat May 14 22:29:26 2005
@@ -25,7 +25,8 @@
/**
* File filter that accepts any {@link PageFlowController} source file (*.jpf).
- * @deprecated
+ *
+ * @deprecated This class will be removed without replacement in the next major release.
*/
public class PageFlowFileFilter implements FilenameFilter
{
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java Sat May 14 22:29:26 2005
@@ -29,6 +29,9 @@
import java.io.Serializable;
import java.lang.reflect.Field;
+/**
+ * Base class for Page Flow managed objects (like page flows and JavaServer Faces backing beans).
+ */
public abstract class PageFlowManagedObject
implements Serializable, HttpSessionBindingListener
{
@@ -41,8 +44,7 @@
/**
- * Initialize transient data that may have been lost during session failover.
- * @exclude
+ * Reinitialize the object for a new request. Used by the framework; normally should not be called directly.
*/
public void reinitialize( HttpServletRequest request, HttpServletResponse response, ServletContext servletContext )
{
@@ -50,8 +52,7 @@
}
/**
- * Initialize.
- * @exclude
+ * Initialize after object creation. This is a framework-invoked method; it should not normally be called directly.
*/
public synchronized void create( HttpServletRequest request, HttpServletResponse response, ServletContext servletContext )
throws Exception
@@ -61,6 +62,10 @@
onCreate();
}
+ /**
+ * Internal destroy method that is invoked when this object is being removed from the session. This is a
+ * framework-invoked method; it should not normally be called directly.
+ */
void destroy( HttpSession session )
{
onDestroy( session );
@@ -68,7 +73,7 @@
}
/**
- * Create-time callback. Occurs after internal initialization (e.g., Java Controls) is done.
+ * Create-time callback. Occurs after internal initialization (e.g., Control fields) is done.
* @throws Exception
*/
protected void onCreate()
@@ -92,8 +97,8 @@
}
/**
- * Callback when this object is removed from the user session. Causes {@link #onDestroy}
- * to be called.
+ * Callback when this object is removed from the user session. Causes {@link #onDestroy} to be called. This is a
+ * framework-invoked method that should not normally be called indirectly.
*/
public void valueUnbound( HttpSessionBindingEvent event )
{
@@ -106,8 +111,8 @@
protected abstract void removeFromSession( HttpServletRequest request );
/**
- * Store this object in the user session, in the appropriate place.
- * @exclude
+ * Store this object in the user session, in the appropriate place. Used by the framework; normally should not be
+ * called directly.
*/
public abstract void persistInSession( HttpServletRequest request, HttpServletResponse response );
@@ -121,11 +126,17 @@
*/
public abstract void ensureFailover( HttpServletRequest request );
+ /**
+ * Get the current ServletContext.
+ */
protected ServletContext getServletContext()
{
return _servletContext;
}
+ /**
+ * Get the display name for this managed object.
+ */
public abstract String getDisplayName();
/**
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObjectException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObjectException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObjectException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObjectException.java Sat May 14 22:29:26 2005
@@ -30,7 +30,9 @@
/**
- * Base class for PageFlow-related Exceptions.
+ * Base class for exceptions related to Page Flow managed objects.
+ *
+ * @see PageFlowManagedObject
*/
public abstract class PageFlowManagedObjectException
extends RuntimeException
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowPageFilter.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowPageFilter.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowPageFilter.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowPageFilter.java Sat May 14 22:29:26 2005
@@ -151,6 +151,7 @@
PageFlowEventReporter er = _servletContainerAdapter.getEventReporter();
_servletContainerAdapter.beginRequest( httpRequest, httpResponse );
er.beginPageRequest( httpRequest, httpResponse );
+ long startTime = System.currentTimeMillis();
//
// Initialize the ControlBeanContext in the session.
@@ -227,7 +228,8 @@
// Callback to the server adapter.
//
_servletContainerAdapter.endRequest( httpRequest, httpResponse );
- er.endPageRequest( httpRequest, httpResponse );
+ long timeTaken = System.currentTimeMillis() - startTime;
+ er.endPageRequest( httpRequest, httpResponse, timeTaken );
}
}
else
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java Sat May 14 22:29:26 2005
@@ -452,13 +452,13 @@
ServletContext servletContext = getServletContext();
//
- // Allow weblogic to do a security check on forwarded requests, if that feature is enabled.
+ // Allow the container to do a security check on forwarded requests, if that feature is enabled.
//
if ( LegacySettings.get( servletContext ).shouldDoSecureForwards()
&& PageFlowRequestWrapper.get( request ).isForwardedRequest() )
{
//
- // In some situations (namely, in scoped requests under portal), the initial weblogic
+ // In some situations (namely, in scoped requests under portal), the initial
// security check may not have been done for the request URI. In this case, a redirect
// to https may happen during checkSecurity().
//
@@ -763,7 +763,9 @@
}
/**
- * TODO v1: comment
+ * A MultipartRequestWrapper that we cache in the outer request once we've handled the multipart request once.
+ * It extends the base Struts MultipartRequestWrapper by being aware of ScopedRequests; for ScopedRequests, it
+ * filters the parameter names accordingly.
*/
private static class RehydratedMultipartRequestWrapper extends MultipartRequestWrapper
{
@@ -837,6 +839,7 @@
PageFlowEventReporter er = _servletContainerAdapter.getEventReporter();
_servletContainerAdapter.beginRequest( request, response );
er.beginActionRequest( request, response );
+ long startTime = System.currentTimeMillis();
//
// Initialize the ControlBeanContext in the session.
@@ -863,7 +866,8 @@
// Callback to the server adapter.
//
_servletContainerAdapter.endRequest( request, response );
- er.endActionRequest( request, response );
+ long timeTaken = System.currentTimeMillis() - startTime;
+ er.endActionRequest( request, response, timeTaken );
}
//
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java Sat May 14 22:29:26 2005
@@ -280,7 +280,8 @@
/**
* Get the a map of shared flow name to shared flow instance, based on the names defined in the
- * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller#sharedFlowRefs} annotation of the
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller#sharedFlowRefs sharedFlowRefs} attribute
+ * of the {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller @Jpf.Controller} annotation on the
* <strong>current page flow</strong>.
*
* @param request the current HttpServletRequest, which is used to determine the current page flow.
@@ -982,8 +983,7 @@
if ( actionOverride != null )
{
- //CR122325 - added modulePath to actionOverride var in URL for case where portlet jpf
- //forwards to another jpf and a refresh is done while action from first jpf is in URL.
+ // The action must be fully-qualified with its module path.
assert actionOverride.charAt( 0 ) == '/' : actionOverride;
InternalStringBuilder uri = new InternalStringBuilder( scopedRequest.getContextPath() );
uri.append( actionOverride );
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PreviousActionInfo.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PreviousActionInfo.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PreviousActionInfo.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PreviousActionInfo.java Sat May 14 22:29:26 2005
@@ -23,7 +23,11 @@
/**
* Stores information about a recent action execution within a pageflow -- used with
- * Used with <code>return-to="previousAction"</code> on <code>@jpf:forward</code>.
+ * Used with
+ * <code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousAction Jpf.NavigateTo.previousAction}</code>
+ * on {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward Jpf.Forward},
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction Jpf.SimpleAction}, or
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.ConditionalForward Jpf.ConditionalForward}.
*/
public class PreviousActionInfo
extends PreviousInfo
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PreviousInfo.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PreviousInfo.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PreviousInfo.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PreviousInfo.java Sat May 14 22:29:26 2005
@@ -21,6 +21,9 @@
import java.io.Serializable;
+/**
+ * Base class for previous-page and previous-action information.
+ */
public abstract class PreviousInfo
implements Serializable
{
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PreviousPageInfo.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PreviousPageInfo.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PreviousPageInfo.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PreviousPageInfo.java Sat May 14 22:29:26 2005
@@ -26,8 +26,12 @@
/**
* Stores information about a previously-displayed page, as well as its initialization data.
- * Used with <code>return-to="currentPage"</code> or <code>return-to="previousPage"</code>
- * on <code>@jpf:forward</code>.
+ * Used with
+ * <code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#currentPage Jpf.NavigateTo.currentPage}</code>
+ * or <code>navigateTo={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousPage Jpf.NavigateTo.previousPage}</code>
+ * on {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward Jpf.Forward},
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction Jpf.SimpleAction}, or
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.ConditionalForward Jpf.ConditionalForward}.
*/
public class PreviousPageInfo
extends PreviousInfo
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/RequestContext.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/RequestContext.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/RequestContext.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/RequestContext.java Sat May 14 22:29:26 2005
@@ -22,6 +22,9 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+/**
+ * Base request/response context.
+ */
public class RequestContext
{
private ServletRequest _request;
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SecurityProtocol.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SecurityProtocol.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SecurityProtocol.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SecurityProtocol.java Sat May 14 22:29:26 2005
@@ -18,7 +18,7 @@
package org.apache.beehive.netui.pageflow;
/**
- * Enumeration to represent secure/unsecure/unspecified values associated with URIs in the webapp.
+ * Enumeration to represent secure/unsecure/unspecified values associated with paths in the webapp.
*/
public class SecurityProtocol
{
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ServletContainerAdapter.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ServletContainerAdapter.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ServletContainerAdapter.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ServletContainerAdapter.java Sat May 14 22:29:26 2005
@@ -25,16 +25,31 @@
/**
- * @exclude
+ * Adapter interface for plugging into various Servlet containers. An implementor of this interface is "discovered" at
+ * runtime. The discovery process is as follows:
+ * <ul>
+ * <li>
+ * A list of META-INF/services/org.apache.beehive.netui.pageflow.ServletContainerAdapter resources is obtained
+ * from classpath. This means, for example, that a file called
+ * "org.apache.beehive.netui.pageflow.ServletContainerAdapter" under directory META-INF/services would be
+ * found inside any JAR file on classpath.
+ * </li>
+ * <li>
+ * Inside each of these resources is the name of a class that implements ServletContainerAdapter. This class
+ * is loaded, and its {@link #accept} method is called.
+ * </li>
+ * <li>
+ * If {@link #accept} returns <code>true</code>, then that implementation class is chosen as the current
+ * adapter; otherwise, the next one in the list is tried.
+ * </li>
+ * <li>If no adapters are discovered, an instance of {@link DefaultServletContainerAdapter} is used.
+ * </ul>
*/
-// TODO v1: comment
public interface ServletContainerAdapter
extends Adapter
{
/**
- * Tell whether the server is running in production mode. This is server-dependent, but by default it should
- * return <code>false</code> only if the System property <code>pageflow:devmode</code> is set.
- *
+ * Tell whether the server is running in production mode.
* @return <code>true</code> if the server is running in production mode.
*/
public boolean isInProductionMode();
@@ -55,25 +70,25 @@
* </security-constraint>
* </pre>
*
- * @param uri a webapp-relative URI for a resource.
+ * @param path a webapp-relative path for a resource.
* @param request the current HttpServletRequest.
* @return <code>Boolean.TRUE</code> if a transport-guarantee of <code>CONFIDENTIAL</code> or
* <code>INTEGRAL</code> is associated with the given resource; <code>Boolean.FALSE</code>
* a transport-guarantee of <code>NONE</code> is associated with the given resource; or
* <code>null</code> if there is no transport-guarantee associated with the given resource.
*/
- public SecurityProtocol getSecurityProtocol( String uri, HttpServletRequest request );
+ public SecurityProtocol getSecurityProtocol( String path, HttpServletRequest request );
/**
- * Cause the server to do a security check for the given URI. If required, it does a redirect to
+ * Cause the server to do a security check for the given path. If required, it does a redirect to
* change the scheme (http/https).
*
- * @param uri the URI on which to run security checks.
+ * @param path the webapp-relative path on which to run security checks.
* @param request the current HttpServletRequest.
* @param response the current HttpServletResponse.
* @return <code>true</code> if a redirect occurred.
*/
- boolean doSecurityRedirect( String uri, HttpServletRequest request, HttpServletResponse response );
+ boolean doSecurityRedirect( String path, HttpServletRequest request, HttpServletResponse response );
/**
@@ -152,7 +167,8 @@
public void endRequest( HttpServletRequest request, HttpServletResponse response );
/**
- * Get a context object to support Java Controls.
+ * Get a context object to support Beehive Controls.
+ *
* @param request the current HttpServletRequest.
* @param response the current HttpServletResponse.
* @return a new ControlBeanContext.
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SessionExpiredException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SessionExpiredException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SessionExpiredException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SessionExpiredException.java Sat May 14 22:29:26 2005
@@ -18,13 +18,18 @@
package org.apache.beehive.netui.pageflow;
-// TODO v1: comment
/**
- * Exception thrown when:
+ * Exception thrown in place of another {@link PageFlowException} when:
* <ul>
- * <li></li>
- * <li></li>
+ * <li>The requested session ID is different than the current session ID (or there is no current session), and</li>
+ * <li>the original exception to be thrown returns <code>true</code> for
+ * {@link PageFlowException#causeMayBeSessionExpiration}, and</li>
+ * <li>The <code><throw-session-expired-exception></code> element in WEB-INF/beehive-netui-config.xml is
+ * set to <code>true</code> (the default)</li>.
* </ul>
+ *
+ * When this exception is thrown, the original exception (considered to be a secondary effect of the session expiration)
+ * can be obtained through {@link #getEffect()}.
*/
public class SessionExpiredException
extends PageFlowException
@@ -42,7 +47,7 @@
return new Object[]{ getActionName(), getFlowControllerURI() };
}
- public String[] getMessageParts()
+ protected String[] getMessageParts()
{
return new String[]
{
@@ -50,11 +55,20 @@
};
}
+ /**
+ * Get the effect of the session expiration; this is the exception that was most likely caused by the session
+ * expiring.
+ */
public Throwable getEffect()
{
return _effect;
}
+ /**
+ * Tell whether the root cause may be session expiration in cases where the requested session ID is different than
+ * the actual session ID. In this case, the answer is <code>true</code> (since this is the exception that is thrown
+ * in for session expiration).
+ */
public boolean causeMayBeSessionExpiration()
{
return false;
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SharedFlowController.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SharedFlowController.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SharedFlowController.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SharedFlowController.java Sat May 14 22:29:26 2005
@@ -30,7 +30,55 @@
import org.apache.beehive.netui.pageflow.internal.InternalConstants;
-// TODO v1: comment
+/**
+ * <p>
+ * Base "shared flow" class for controller logic, exception handlers, and state that can be shared by any number of page
+ * flows. A shared flow is <i>not</i> a page flow; it is used by page flows, but never becomes the "current page flow"
+ * (see {@link PageFlowController} for information on page flows and the "current page flow").
+ * The class is configured through the
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller @Jpf.Controller} annotation.
+ * </p>
+ *
+ * <p>
+ * A shared flow comes into existance in one of two ways:
+ * <ul>
+ * <li>
+ * A page flow is hit, and the page flow refers to the shared flow in its
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller#sharedFlowRefs sharedFlowRefs}
+ * annotation attribute, or
+ * </li>
+ * <li>
+ * Any page flow is hit, and the <code><default-shared-flow-refs></code> element in
+ * /WEB-INF/beehive-netui-config.xml declares that this shared flow will be used by all page flows in the web
+ * application.
+ * </li>
+ * </ul>
+ * When a shared flow is created, it is stored in the user session. It is only removed through a call to
+ * {@link #remove} or through a call to {@link PageFlowUtils#removeSharedFlow}.
+ * </p>
+ *
+ * <p>
+ * Shared flow actions are defined with <i>action methods</i> or <i>action annotations</i> that determine the next URI
+ * to be displayed, after optionally performing arbitrary logic. A page or page flow can raise a shared flow action
+ * using the pattern <code>"</code><i>shared-flow-name</i><code>.</code><i>action-name</i><code>"</code>. The shared
+ * flow name is the one chosen by the page flow
+ * in {@link org.apache.beehive.netui.pageflow.annotations.Jpf.SharedFlowRef#name name}
+ * on {@link org.apache.beehive.netui.pageflow.annotations.Jpf.SharedFlowRef @Jpf.SharedFlowRef}.
+ * </p>
+ *
+ * <p>
+ * A referenced shared flow gets the chance to handle any uncaught page flow exception. It declares its exception
+ * handling through {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller#catches catches}
+ * on {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller @Jpf.Controller}.
+ * </p>
+ *
+ * <p>
+ * Properties in the current shared flow instance can be accessed from JSP 2.0-style expressions like this one:
+ * <code>${sharedFlow.</code><i>sharedFlowName</i><code>.someProperty}</code>.
+ * </p>
+ *
+ * @see PageFlowController
+ */
public abstract class SharedFlowController
extends FlowController
implements PageFlowConstants
@@ -38,9 +86,9 @@
private transient String _modulePath;
/**
- * Get the Struts module path.
+ * Get the Struts module path for actions in this shared flow.
*
- * @return "/-global".
+ * @return the Struts module path for actions in this shared flow.
*/
public String getModulePath()
{
@@ -56,18 +104,23 @@
return _modulePath;
}
+ /**
+ * Store this object in the user session, in the appropriate place. Used by the framework; normally should not be
+ * called directly.
+ */
public void persistInSession( HttpServletRequest request, HttpServletResponse response )
{
request.getSession().setAttribute( InternalConstants.SHARED_FLOW_ATTR_PREFIX + getClass().getName(), this );
}
/**
- * Ensures that any changes to this FlowController will be replicated in a cluster (for failover),
+ * Ensures that any changes to this object will be replicated in a cluster (for failover),
* even if the replication scheme uses a change-detection algorithm that relies on
- * HttpSession.setAttribute to be aware of changes.
+ * HttpSession.setAttribute to be aware of changes. Note that this method is used by the framework
+ * and does not need to be called explicitly in most cases.
*
* @param request the current HttpServletRequest
- */
+ */
public void ensureFailover( HttpServletRequest request )
{
ServletContainerAdapter servletContainerAdapter = AdapterManager.getServletContainerAdapter( getServletContext() );
@@ -83,6 +136,10 @@
return "/";
}
+ /**
+ * Get the display name. The display name for a shared flow is simply the class name.
+ * @return the name of the shared flow class.
+ */
public String getDisplayName()
{
return getClass().getName();
@@ -99,8 +156,8 @@
}
/**
- * Store information about recent pages displayed. Usually should not be called directly.
- * @exclude
+ * Store information about recent pages displayed. This is a framework-invoked method that should not normally be
+ * called directly.
*/
public void savePreviousPageInfo( ActionForward forward, ActionForm form, ActionMapping mapping,
HttpServletRequest request, ServletContext servletContext,
@@ -124,6 +181,10 @@
}
}
+ /**
+ * Store information about the most recent action invocation. This is a framework-invoked method that should not
+ * normally be called directly
+ */
void savePreviousActionInfo( ActionForm form, HttpServletRequest request, ActionMapping mapping,
ServletContext servletContext )
{
@@ -135,7 +196,7 @@
}
/**
- * Remove this instance from the session.
+ * Remove this instance from the session. When inside a shared flow action, {@link #remove} may be called instead.
*/
protected synchronized void removeFromSession( HttpServletRequest request )
{
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/StrutsModuleFactory.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/StrutsModuleFactory.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/StrutsModuleFactory.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/StrutsModuleFactory.java Sat May 14 22:29:26 2005
@@ -23,7 +23,7 @@
/**
- * @exclude
+ * @deprecated This class will be removed without replacement in the next major release.
*/
public class StrutsModuleFactory
{
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnfulfilledRolesException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnfulfilledRolesException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnfulfilledRolesException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnfulfilledRolesException.java Sat May 14 22:29:26 2005
@@ -24,9 +24,10 @@
/**
- * Exception that is thrown when an action method marked with <code>@jpf:action
- * roles-allowed="</code><i>roles</i><code>"</code> is hit when there is a logged-in user
- * who does not fulfil any of the given roles.
+ * Exception that is thrown when <code>rolesAllowed</code> is set on the current action's annotation
+ * ({@link org.apache.beehive.netui.pageflow.annotations.Jpf.Action @Jpf.Action} or
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.SimpleAction @Jpf.SimpleAction}), and there is a logged-in
+ * user who does not fulfil any of the given roles.
*/
public class UnfulfilledRolesException
extends PageFlowException
@@ -78,6 +79,10 @@
response.sendError( HttpServletResponse.SC_BAD_REQUEST, msg );
}
+ /**
+ * Tell whether the root cause may be session expiration in cases where the requested session ID is different than
+ * the actual session ID. In this case, the answer is <code>true</code>.
+ */
public boolean causeMayBeSessionExpiration()
{
return true;
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnresolvableForwardException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnresolvableForwardException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnresolvableForwardException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnresolvableForwardException.java Sat May 14 22:29:26 2005
@@ -19,8 +19,9 @@
/**
- * Exception thrown by {@link Forward} when a forward name does not resolve to a forward defined
- * by <code>@jpf:forward</code>.
+ * Exception thrown by {@link Forward} when its name does not resolve to one defined by a
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward} annotation in the current action's
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Action @Jpf.Action} annotation.
*/
public class UnresolvableForwardException extends PageFlowException
{
@@ -70,6 +71,10 @@
};
}
+ /**
+ * Tell whether the root cause may be session expiration in cases where the requested session ID is different than
+ * the actual session ID. In this case, the answer is <code>false</code>.
+ */
public boolean causeMayBeSessionExpiration()
{
return false;
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Validatable.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Validatable.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Validatable.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Validatable.java Sat May 14 22:29:26 2005
@@ -25,7 +25,7 @@
/**
* Interface for beans that can validate themselves. Called when data is posted to a page flow action that takes
- * a non-{@link FormData}-derived bean as its argument.
+ * the bean as its argument.
*/
public interface Validatable
{