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 [1/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/
Author: rich
Date: Sat May 14 22:29:26 2005
New Revision: 170197
URL: http://svn.apache.org/viewcvs?rev=170197&view=rev
Log:
Overhaul of javadoc for Page Flow classes. Ahh... much better.
Also, moved DefaultPageFlowEventReporter to an outer class.
tests: bvt in netui (WinXP)
BB: self (linux)
Added:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DefaultPageFlowEventReporter.java (with props)
Modified:
incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/grammar/CatchGrammar.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ActionNotFoundException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ActionResolver.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ActionResult.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/AutoRegisterActionServlet.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ControlFieldInitializationException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DefaultServletContainerAdapter.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DoubleSubmitException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/EmptyNestingStackException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ExpressionMessage.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FacesBackingBean.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Factory.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowControllerFactory.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FormData.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Forward.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/GlobalApp.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalActionOutputException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalOutputFormException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalOutputFormTypeException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalPageInputException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/IllegalRedirectOutputFormException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/InfiniteReturnToActionException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MismatchedActionOutputException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/MissingActionOutputException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoCurrentPageFlowException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoMatchingActionMethodException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoPreviousActionException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NoPreviousPageException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NotLoggedInException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowActionServlet.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowContextListener.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowEventReporter.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowFacesFilter.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowFileFilter.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObject.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObjectException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowPageFilter.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PreviousActionInfo.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PreviousInfo.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PreviousPageInfo.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/RequestContext.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SecurityProtocol.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ServletContainerAdapter.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SessionExpiredException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/SharedFlowController.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/StrutsModuleFactory.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnfulfilledRolesException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/UnresolvableForwardException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Validatable.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/config/PageFlowActionFormBean.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/config/PageFlowActionForward.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/config/PageFlowActionMapping.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/config/PageFlowControllerConfig.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/config/PageFlowExceptionConfig.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/PageFlowApplicationFactory.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/BackingClassMethodBinding.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/PageFlowActionListener.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/PageFlowApplication.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/PageFlowNavigationHandler.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/PageFlowViewHandler.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/handler/ActionForwardHandler.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/handler/FlowControllerHandlerContext.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/handler/HandlerConfig.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/handler/Handlers.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/handler/LoginHandler.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/InterceptorChain.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/InterceptorConfig.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/InterceptorContext.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/InterceptorException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/action/ActionInterceptor.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/action/ActionInterceptorContext.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/action/AfterNestedInterceptContext.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/action/OriginalForward.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/request/RequestInterceptor.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/request/RequestInterceptorContext.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultExceptionsHandler.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/ReturnToException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/validation/ValidatorRules.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/xmlhttprequest/XmlHttpRequestServlet.java
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ParseUtils.java
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/pageinput/DeclarePageInput.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java
incubator/beehive/trunk/netui/src/tomcat-server/5x/org/apache/beehive/netui/tomcat/PageflowValve.java
Modified: incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/grammar/CatchGrammar.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/grammar/CatchGrammar.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/grammar/CatchGrammar.java (original)
+++ incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/grammar/CatchGrammar.java Sat May 14 22:29:26 2005
@@ -131,8 +131,8 @@
AnnotationInstance[] parentAnnotations, MemberDeclaration classMember )
{
//
- // Make sure the current entity (class or action method) doesn't have two @jpf:catch annotations
- // that refer to methods with duplicate @jpf:forwards.
+ // Make sure the current entity (class or action method) doesn't have two @Jpf.Catch annotations
+ // that refer to methods with duplicate @Jpf.Forwards.
//
Collection catches =
CompilerUtils.getAnnotationArrayValue( classMember, _annotationRootName, CATCHES_ATTR, true );
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ActionNotFoundException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ActionNotFoundException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ActionNotFoundException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ActionNotFoundException.java Sat May 14 22:29:26 2005
@@ -48,6 +48,10 @@
return _form;
}
+ /**
+ * 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/ActionResolver.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ActionResolver.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ActionResolver.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ActionResolver.java Sat May 14 22:29:26 2005
@@ -23,8 +23,7 @@
/**
- * Interface for Struts-based classes that resolve actions to URIs.
- * @exclude
+ * Interface for controller classes that resolve actions to URIs.
*/
public interface ActionResolver
{
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ActionResult.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ActionResult.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ActionResult.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ActionResult.java Sat May 14 22:29:26 2005
@@ -35,12 +35,14 @@
public String getStatusMessage();
/**
- * @deprecated This method now always returns false; compilation no longer happens at runtime.
+ * @deprecated This method now always returns false; compilation no longer happens at runtime. It will be removed
+ * in the next major release.
*/
public boolean hadCompileErrors();
/**
- * @deprecated This method has no effect; compilation no longer happens at runtime.
+ * @deprecated This method has no effect; compilation no longer happens at runtime. It will be removed in the next
+ * major release.
*/
public void printCompileErrors( PrintWriter writer );
}
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/AutoRegisterActionServlet.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/AutoRegisterActionServlet.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/AutoRegisterActionServlet.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/AutoRegisterActionServlet.java Sat May 14 22:29:26 2005
@@ -67,10 +67,9 @@
/**
- * ActionServlet that dynamically registers requested modules based on registered module
- * configuration file locators. The user may specify {@link ModuleConfigLocator} classes
- * in web.xml, using the "moduleConfigLocators" init-parameter; this allows the user to
- * define patterns for auto-registered Struts modules.
+ * ActionServlet that automatically registers requested Struts modules based on a set of module configuration file
+ * locators. The user may specify {@link ModuleConfigLocator} classes in /WEB-INF/beehive-netui-config.xml using the
+ * <code><module-config-locators></code> element.
*/
public class AutoRegisterActionServlet extends ActionServlet
{
@@ -298,12 +297,7 @@
private void readObject( ObjectInputStream stream )
throws IOException, ClassNotFoundException
{
- if ( _log.isInfoEnabled() )
- {
- _log.info( "deserializing ActionServlet " + this );
- }
-
-
+ if ( _log.isInfoEnabled() ) _log.info( "deserializing ActionServlet " + this );
_configParams = ( Map ) stream.readObject();
}
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ControlFieldInitializationException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ControlFieldInitializationException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ControlFieldInitializationException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ControlFieldInitializationException.java Sat May 14 22:29:26 2005
@@ -17,6 +17,9 @@
*/
package org.apache.beehive.netui.pageflow;
+/**
+ * Exception thrown when there are errors initializing an annotated Control field.
+ */
public class ControlFieldInitializationException
extends PageFlowManagedObjectException
{
@@ -36,7 +39,7 @@
return new Object[]{ _fieldName, getManagedObject().getDisplayName() };
}
- public String[] getMessageParts()
+ protected String[] getMessageParts()
{
return new String[]
{
Added: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DefaultPageFlowEventReporter.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DefaultPageFlowEventReporter.java?rev=170197&view=auto
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DefaultPageFlowEventReporter.java (added)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DefaultPageFlowEventReporter.java Sat May 14 22:29:26 2005
@@ -0,0 +1,211 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.pageflow;
+
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.beehive.netui.util.internal.InternalStringBuilder;
+import org.apache.beehive.netui.util.logging.Logger;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+/**
+ * Default event reporter. Logs every event when the log level is set to "debug" or "trace".
+ */
+public class DefaultPageFlowEventReporter
+ extends PageFlowEventReporter
+{
+ private static final Logger _log = Logger.getInstance( DefaultPageFlowEventReporter.class );
+
+ protected DefaultPageFlowEventReporter( ServletContext servletContext )
+ {
+ super( servletContext );
+ }
+
+ public void actionRaised( FlowController flowController, ActionMapping mapping, ActionForm form,
+ ServletRequest request, ServletResponse response )
+ {
+ if ( _log.isDebugEnabled() )
+ {
+ LogMsg msg = new LogMsg( "actionRaised" );
+ msg.addParam( "FlowController", flowController );
+ msg.addParam( "ActionMapping", mapping );
+ msg.addParam( "ActionForm", form );
+ msg.addParam( "Request", request );
+ msg.addParam( "Response", response );
+ _log.debug( msg );
+ }
+ }
+
+ public void actionSuccess( FlowController flowController, ActionMapping mapping, ActionForm form,
+ ServletRequest request, ServletResponse response, ActionForward result,
+ long timeTakenMillis )
+ {
+ if ( _log.isDebugEnabled() )
+ {
+ LogMsg msg = new LogMsg( "actionSuccess" );
+ msg.addParam( "FlowController", flowController );
+ msg.addParam( "ActionMapping", mapping );
+ msg.addParam( "ActionForm", form );
+ msg.addParam( "Request", request );
+ msg.addParam( "Response", response );
+ msg.addParam( "ActionForward", result );
+ msg.addParam( "TimeTakenMillis", new Long( timeTakenMillis ) );
+ _log.debug( msg );
+ }
+ }
+
+ public void exceptionRaised( Throwable ex, ActionMapping actionMapping, ActionForm form,
+ FlowController flowController, ServletRequest request,
+ ServletResponse response )
+ {
+ if ( _log.isDebugEnabled() )
+ {
+ LogMsg msg = new LogMsg( "exceptionRaised" );
+ msg.addParam( "Throwable", ex );
+ msg.addParam( "ActionMapping", actionMapping );
+ msg.addParam( "ActionForm", form );
+ msg.addParam( "FlowController", flowController );
+ msg.addParam( "Request", request );
+ msg.addParam( "Response", response );
+ _log.debug( msg );
+ }
+ }
+
+ public void exceptionHandled( Throwable ex, ActionMapping actionMapping, ActionForm form,
+ FlowController flowController, ServletRequest request,
+ ServletResponse response, ActionForward result,
+ long timeTakenMillis )
+ {
+ if ( _log.isDebugEnabled() )
+ {
+ LogMsg msg = new LogMsg( "exceptionHandled" );
+ msg.addParam( "Throwable", ex );
+ msg.addParam( "ActionMapping", actionMapping );
+ msg.addParam( "ActionForm", form );
+ msg.addParam( "FlowController", flowController );
+ msg.addParam( "Request", request );
+ msg.addParam( "Response", response );
+ msg.addParam( "ActionForward", result );
+ msg.addParam( "TimeTakenMillis", new Long( timeTakenMillis ) );
+ _log.debug( msg );
+ }
+ }
+
+ public void flowControllerCreated( FlowController flowController, ServletRequest request,
+ ServletResponse response )
+ {
+ if ( _log.isDebugEnabled() )
+ {
+ LogMsg msg = new LogMsg( "flowControllerCreated" );
+ msg.addParam( "FlowController", flowController );
+ msg.addParam( "Request", request );
+ msg.addParam( "Response", response );
+ _log.debug( msg );
+ }
+ }
+
+ public void flowControllerDestroyed( FlowController flowController )
+ {
+ if ( _log.isDebugEnabled() )
+ {
+ LogMsg msg = new LogMsg( "flowControllerDestroyed" );
+ msg.addParam( "FlowController", flowController );
+ _log.debug( msg );
+ }
+ }
+
+ public void beginActionRequest( ServletRequest request, ServletResponse response )
+ {
+ if ( _log.isDebugEnabled() )
+ {
+ LogMsg msg = new LogMsg( "beginActionRequest" );
+ msg.addParam( "Request", request );
+ msg.addParam( "Response", response );
+ _log.debug( msg );
+ }
+ }
+
+ public void endActionRequest( ServletRequest request, ServletResponse response, long timeTakenMillis )
+ {
+ if ( _log.isDebugEnabled() )
+ {
+ LogMsg msg = new LogMsg( "endActionRequest" );
+ msg.addParam( "Request", request );
+ msg.addParam( "Response", response );
+ msg.addParam( "TimeTakenMillis", new Long( timeTakenMillis ) );
+ _log.debug( msg );
+ }
+ }
+
+ public void beginPageRequest( ServletRequest request, ServletResponse response )
+ {
+ if ( _log.isDebugEnabled() )
+ {
+ LogMsg msg = new LogMsg( "beginPageRequest" );
+ msg.addParam( "Request", request );
+ msg.addParam( "Response", response );
+ _log.debug( msg );
+ }
+ }
+
+ public void endPageRequest( ServletRequest request, ServletResponse response, long timeTakenMillis )
+ {
+ if ( _log.isDebugEnabled() )
+ {
+ LogMsg msg = new LogMsg( "endPageRequest" );
+ msg.addParam( "Request", request );
+ msg.addParam( "Response", response );
+ msg.addParam( "TimeTakenMillis", new Long( timeTakenMillis ) );
+ _log.debug( msg );
+ }
+ }
+
+ protected static class LogMsg
+ {
+ private String _eventName;
+ private InternalStringBuilder _logMessage;
+
+ public LogMsg( String eventName )
+ {
+ _eventName = eventName;
+ }
+
+ public void addParam( String name, Object value )
+ {
+ if ( _logMessage == null )
+ {
+ _logMessage = new InternalStringBuilder( _eventName ).append( ": " );
+ }
+ else
+ {
+ _logMessage.append( ", " );
+ }
+
+ _logMessage.append( name ).append( '=' ).append( value );
+ }
+
+ public String toString()
+ {
+ return _logMessage == null ? _eventName : _logMessage.toString();
+ }
+ }
+}
Propchange: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DefaultPageFlowEventReporter.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DefaultServletContainerAdapter.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DefaultServletContainerAdapter.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DefaultServletContainerAdapter.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DefaultServletContainerAdapter.java Sat May 14 22:29:26 2005
@@ -17,29 +17,22 @@
*/
package org.apache.beehive.netui.pageflow;
-import org.apache.beehive.netui.util.internal.InternalStringBuilder;
-
-import org.apache.beehive.netui.pageflow.internal.PageFlowBeanContext;
import org.apache.beehive.netui.pageflow.adapter.AdapterContext;
+import org.apache.beehive.netui.pageflow.internal.PageFlowBeanContext;
import org.apache.beehive.netui.util.logging.Logger;
+import javax.security.auth.login.LoginException;
import javax.servlet.ServletContext;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import javax.security.auth.login.LoginException;
-
-import org.apache.struts.action.ActionMapping;
-import org.apache.struts.action.ActionForm;
-import org.apache.struts.action.ActionForward;
+/**
+ * Default implementation of a Servlet container adapter.
+ */
public abstract class DefaultServletContainerAdapter
implements ServletContainerAdapter
{
- private static final Logger _log = Logger.getInstance( DefaultServletContainerAdapter.class );
-
private static boolean _productionMode = true;
private ServletContext _servletContext;
@@ -80,29 +73,59 @@
return _productionMode;
}
- public SecurityProtocol getSecurityProtocol( String uri, HttpServletRequest request )
+ /**
+ * Tell whether a web application resource requires a secure transport protocol. This default implementation
+ * simply returns {@link SecurityProtocol#UNSPECIFIED} for all paths.
+ *
+ * @param path a webapp-relative path for a resource.
+ * @param request the current HttpServletRequest.
+ * @return {@link SecurityProtocol#UNSPECIFIED}.
+ */
+ public SecurityProtocol getSecurityProtocol( String path, HttpServletRequest request )
{
// TODO: implement this based on parsing of web.xml
return SecurityProtocol.UNSPECIFIED;
}
- public boolean doSecurityRedirect( String uri, HttpServletRequest request, HttpServletResponse response )
+ /**
+ * Cause the server to do a security check for the given path. This default implementation does nothing.
+ * @return <code>false</code>
+ */
+ public boolean doSecurityRedirect( String path, HttpServletRequest request, HttpServletResponse response )
{
return false;
}
+ /**
+ * Get the port on which the server is listening for unsecure connections. This default implementation always
+ * returns <code>-1</code>.
+ * @param request the current HttpServletRequest.
+ * @return <code>-1</code>.
+ */
public int getListenPort( HttpServletRequest request )
{
// TODO: have a configuration in netui-config.xml to specify this; an alternative to having to have an adapter.
return -1;
}
+ /**
+ * Get the port on which the server is listening for secure connections. This default implementation always
+ * returns <code>-1</code>.
+ * @param request the current HttpServletRequest.
+ * @return <code>-1</code>.
+ */
public int getSecureListenPort( HttpServletRequest request )
{
// TODO: have a configuration in netui-config.xml to specify this; an alternative to having to have an adapter.
return -1;
}
+ /**
+ * Log in the user, using "weak" username/password authentication. This default implementation always throws
+ * {@link UnsupportedOperationException}.
+ *
+ * @throws UnsupportedOperationException in all cases.
+ */
public void login( String username, String password, HttpServletRequest request, HttpServletResponse response )
throws LoginException
{
@@ -110,232 +133,116 @@
+ DefaultServletContainerAdapter.class.getName() );
}
+ /**
+ * Log out the user. This default implementation always throws {@link UnsupportedOperationException}.
+ *
+ * @throws UnsupportedOperationException in all cases.
+ */
public void logout( boolean invalidateSessions, HttpServletRequest request, HttpServletResponse response )
{
throw new UnsupportedOperationException( "logout is not supported by "
+ DefaultServletContainerAdapter.class.getName() );
}
+ /**
+ * Return the webapp context path for the given request. This can differ from HttpServletRequest.getContextPath()
+ * only in that it will return a valid value even if the request is for the default webapp. This default
+ * implementation always returns the value of <code>getContextPath()</code> on the request.
+ *
+ * @param request the current HttpServletRequest.
+ * @return the value of <code>getContextPath()</code> on the current request.
+ */
public String getFullContextPath( HttpServletRequest request )
{
return request.getContextPath();
}
/**
- * This default implementation does nothing; the functionality (and the need for it) is server-specific.
+ * Ensure that the given session attribute is replicated in a cluster for session failover.
+ * This method does not need to be implemented for servers that do not support clustering and
+ * session failover. The default implementation does nothing.
+ *
+ * @param attrName the name of the session attribute for which failover should be ensured.
+ * @param attrVal the value of the given session attribute.
+ * @param request the current HttpServletRequest.
*/
public void ensureFailover( String attrName, Object attrVal, HttpServletRequest request )
{
}
+ /**
+ * Called at the beginning of each processed request. This default implementation does nothing.
+ *
+ * @param request the current HttpServletRequest.
+ * @param response the current HttpServletResponse.
+ */
public void beginRequest( HttpServletRequest request, HttpServletResponse response )
{
}
+ /**
+ * Called at the end of each processed request. This default implementation does nothing.
+ *
+ * @param request the current HttpServletRequest.
+ * @param response the current HttpServletResponse.
+ */
public void endRequest( HttpServletRequest request, HttpServletResponse response )
{
}
+ /**
+ * Get a context object to support Beehive Controls. This default implementation returns an instance of
+ * {@link PageFlowBeanContext}.
+ *
+ * @param request the current HttpServletRequest.
+ * @param response the current HttpServletResponse.
+ * @return a new ControlBeanContext.
+ */
public Object createControlBeanContext( HttpServletRequest request, HttpServletResponse response )
{
return new PageFlowBeanContext();
}
+ /**
+ * Get the current ServletContext.
+ * @return the current ServletContext.
+ */
protected ServletContext getServletContext()
{
return _servletContext;
}
+ /**
+ * Set the AdapterContext.
+ * @param context the AdapterContext to set.
+ */
public void setContext( AdapterContext context )
{
Object servletContext = context.getExternalContext();
assert servletContext instanceof ServletContext : servletContext;
_servletContext = ( ServletContext ) servletContext;
- _eventReporter = new DefaultEventReporter( _servletContext );
+ _eventReporter = new DefaultPageFlowEventReporter( _servletContext );
}
+ /**
+ * Get the name of the platform, which may be used to find platform-specific configuration files. This default
+ * implementation returns "generic".
+ *
+ * @return the name of the platform ("generic" in this default implementation).
+ */
public String getPlatformName()
{
return "generic";
}
- public PageFlowEventReporter getEventReporter()
- {
- return _eventReporter;
- }
-
/**
- * Default event reporter. Logs every event when the log level is set to "debug" or "trace".
+ * Get an event reporter, which will be notified of events like "page flow created", "action raised", etc.
+ * This default implementation returns an instance of {@link DefaultPageFlowEventReporter}.
+ *
+ * @return a {@link PageFlowEventReporter}.
*/
- public static class DefaultEventReporter
- extends PageFlowEventReporter
+ public PageFlowEventReporter getEventReporter()
{
- protected DefaultEventReporter( ServletContext servletContext )
- {
- super( servletContext );
- }
-
- public void actionRaised( FlowController flowController, ActionMapping mapping, ActionForm form,
- ServletRequest request, ServletResponse response )
- {
- if ( _log.isDebugEnabled() )
- {
- LogMsg msg = new LogMsg( "actionRaised" );
- msg.addParam( "FlowController", flowController );
- msg.addParam( "ActionMapping", mapping );
- msg.addParam( "ActionForm", form );
- msg.addParam( "Request", request );
- msg.addParam( "Response", response );
- _log.debug( msg );
- }
- }
-
- public void actionSuccess( FlowController flowController, ActionMapping mapping, ActionForm form,
- ServletRequest request, ServletResponse response, ActionForward result )
- {
- if ( _log.isDebugEnabled() )
- {
- LogMsg msg = new LogMsg( "actionSuccess" );
- msg.addParam( "FlowController", flowController );
- msg.addParam( "ActionMapping", mapping );
- msg.addParam( "ActionForm", form );
- msg.addParam( "Request", request );
- msg.addParam( "Response", response );
- msg.addParam( "ActionForward", result );
- _log.debug( msg );
- }
- }
-
- public void exceptionRaised( Throwable ex, ActionMapping actionMapping, ActionForm form,
- FlowController flowController, ServletRequest request,
- ServletResponse response )
- {
- if ( _log.isDebugEnabled() )
- {
- LogMsg msg = new LogMsg( "exceptionRaised" );
- msg.addParam( "Throwable", ex );
- msg.addParam( "ActionMapping", actionMapping );
- msg.addParam( "ActionForm", form );
- msg.addParam( "FlowController", flowController );
- msg.addParam( "Request", request );
- msg.addParam( "Response", response );
- _log.debug( msg );
- }
- }
-
- public void exceptionHandled( Throwable ex, ActionMapping actionMapping, ActionForm form,
- FlowController flowController, ServletRequest request,
- ServletResponse response, ActionForward result )
- {
- if ( _log.isDebugEnabled() )
- {
- LogMsg msg = new LogMsg( "exceptionHandled" );
- msg.addParam( "Throwable", ex );
- msg.addParam( "ActionMapping", actionMapping );
- msg.addParam( "ActionForm", form );
- msg.addParam( "FlowController", flowController );
- msg.addParam( "Request", request );
- msg.addParam( "Response", response );
- msg.addParam( "ActionForward", result );
- _log.debug( msg );
- }
- }
-
- public void flowControllerCreated( FlowController flowController, ServletRequest request,
- ServletResponse response )
- {
- if ( _log.isDebugEnabled() )
- {
- LogMsg msg = new LogMsg( "flowControllerCreated" );
- msg.addParam( "FlowController", flowController );
- msg.addParam( "Request", request );
- msg.addParam( "Response", response );
- _log.debug( msg );
- }
- }
-
- public void flowControllerDestroyed( FlowController flowController )
- {
- if ( _log.isDebugEnabled() )
- {
- LogMsg msg = new LogMsg( "flowControllerDestroyed" );
- msg.addParam( "FlowController", flowController );
- _log.debug( msg );
- }
- }
-
- public void beginActionRequest( ServletRequest request, ServletResponse response )
- {
- if ( _log.isDebugEnabled() )
- {
- LogMsg msg = new LogMsg( "beginActionRequest" );
- msg.addParam( "Request", request );
- msg.addParam( "Response", response );
- _log.debug( msg );
- }
- }
-
- public void endActionRequest( ServletRequest request, ServletResponse response )
- {
- if ( _log.isDebugEnabled() )
- {
- LogMsg msg = new LogMsg( "endActionRequest" );
- msg.addParam( "Request", request );
- msg.addParam( "Response", response );
- _log.debug( msg );
- }
- }
-
- public void beginPageRequest( ServletRequest request, ServletResponse response )
- {
- if ( _log.isDebugEnabled() )
- {
- LogMsg msg = new LogMsg( "beginPageRequest" );
- msg.addParam( "Request", request );
- msg.addParam( "Response", response );
- _log.debug( msg );
- }
- }
-
- public void endPageRequest( ServletRequest request, ServletResponse response )
- {
- if ( _log.isDebugEnabled() )
- {
- LogMsg msg = new LogMsg( "endPageRequest" );
- msg.addParam( "Request", request );
- msg.addParam( "Response", response );
- _log.debug( msg );
- }
- }
-
- private static class LogMsg
- {
- private String _eventName;
- private InternalStringBuilder _logMessage;
-
- public LogMsg( String eventName )
- {
- _eventName = eventName;
- }
-
- public void addParam( String name, Object value )
- {
- if ( _logMessage == null )
- {
- _logMessage = new InternalStringBuilder( _eventName ).append( ": " );
- }
- else
- {
- _logMessage.append( ", " );
- }
-
- _logMessage.append( name ).append( '=' ).append( value );
- }
-
- public String toString()
- {
- return _logMessage == null ? _eventName : _logMessage.toString();
- }
- }
+ return _eventReporter;
}
}
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DoubleSubmitException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DoubleSubmitException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DoubleSubmitException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/DoubleSubmitException.java Sat May 14 22:29:26 2005
@@ -20,6 +20,11 @@
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
+/**
+ * Exception thrown when an action marked with the
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Action#preventDoubleSubmit @Jpf.Action(preventDoubleSubmit=...}
+ * annotation attribute has been submitted to more than once.
+ */
public class DoubleSubmitException
extends PageFlowException
implements ResponseErrorCodeSender
@@ -44,6 +49,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/EmptyNestingStackException.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/EmptyNestingStackException.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/EmptyNestingStackException.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/EmptyNestingStackException.java Sat May 14 22:29:26 2005
@@ -20,7 +20,8 @@
/**
* Exception that occurs when the user invokes an action in a nested page flow that uses a
- * <code>@{@link org.apache.beehive.netui.pageflow.annotations.Jpf Jpf}.Forward(returnAction="</code><i>action-name-in-calling-pageflow</i><code>")</code>
+ * <code>{@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward}(</code>...<code>
+ * returnAction="</code><i>action-name-in-calling-pageflow</i><code>")</code>
* annotation, but there is no calling page flow. This can happen in iterative
* development mode when you have modified files and caused the web application to be redeployed,
* or when the session expires.
@@ -42,6 +43,10 @@
return new String[]{ "Empty nesting stack for returned action ", " from Page Flow ", "." };
}
+ /**
+ * 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/ExpressionMessage.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ExpressionMessage.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ExpressionMessage.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ExpressionMessage.java Sat May 14 22:29:26 2005
@@ -26,13 +26,82 @@
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
-// TODO v1 comment this class
+/**
+ * Extension of the base Struts ActionMessage; instead of retrieving messages and their arguments from message
+ * resources, it calculates them by evaluating JSP 2.0-style expressions (or, in the degenerate case, from hardcoded
+ * strings).
+ */
public class ExpressionMessage
extends ActionMessage
{
+ /**
+ * Constructor, using an array for the message arguments.
+ *
+ * @param expression the JSP 2.0-style expression (e.g., <code>${pageFlow.myProperty}</code>) or literal string
+ * that will be used as the message.
+ * @param messageArgExpressions an array of JSP 2.0-style expressions <i>or</i> raw Objects to be used as arguments
+ * to the message. Expressions are evaluated; all other Objects are passed as-is.
+ */
public ExpressionMessage( String expression, Object[] messageArgExpressions )
{
super( InternalConstants.MESSAGE_IS_EXPRESSION_PREFIX + expression, prefixArgs( messageArgExpressions ) );
+ }
+
+ /**
+ * Constructor, for a message without message arguments.
+ *
+ * @param expression the JSP 2.0-style expression (e.g., <code>${pageFlow.myProperty}</code>) or literal string
+ * that will be used as the message.
+ */
+ public ExpressionMessage( String expression )
+ {
+ this( expression, null );
+ }
+
+ /**
+ * Constructor, for a message with a single argument.
+ *
+ * @param expression the JSP 2.0-style expression (e.g., <code>${pageFlow.myProperty}</code>) or literal string
+ * that will be used as the message.
+ * @param messageArgExpression a JSP 2.0-style expression <i>or</i> raw Object to be used the argument
+ * to the message. Expressions are evaluated; all other Objects are passed as-is.
+ */
+ public ExpressionMessage( String expression, Object messageArgExpression )
+ {
+ this( expression, new Object[]{ messageArgExpression } );
+ }
+
+ /**
+ * Constructor, for a message with two arguments.
+ *
+ * @param expression the JSP 2.0-style expression (e.g., <code>${pageFlow.myProperty}</code>) or literal string
+ * that will be used as the message.
+ * @param messageArgExpression1 a JSP 2.0-style expression <i>or</i> raw Object to be used the first argument
+ * to the message. Expressions are evaluated; all other Objects are passed as-is.
+ * @param messageArgExpression2 a JSP 2.0-style expression <i>or</i> raw Object to be used the second argument
+ * to the message. Expressions are evaluated; all other Objects are passed as-is.
+ */
+ public ExpressionMessage( String expression, Object messageArgExpression1, Object messageArgExpression2 )
+ {
+ this( expression, new Object[]{ messageArgExpression1, messageArgExpression2 } );
+ }
+
+ /**
+ * Constructor, for a message with two arguments.
+ *
+ * @param expression the JSP 2.0-style expression (e.g., <code>${pageFlow.myProperty}</code>) or literal string
+ * that will be used as the message.
+ * @param messageArgExpression1 a JSP 2.0-style expression <i>or</i> raw Object to be used the first argument
+ * to the message. Expressions are evaluated; all other Objects are passed as-is.
+ * @param messageArgExpression2 a JSP 2.0-style expression <i>or</i> raw Object to be used the second argument
+ * to the message. Expressions are evaluated; all other Objects are passed as-is.
+ * @param messageArgExpression3 a JSP 2.0-style expression <i>or</i> raw Object to be used the third argument
+ * to the message. Expressions are evaluated; all other Objects are passed as-is.
+ */
+ public ExpressionMessage( String expression, Object messageArgExpression1, Object messageArgExpression2,
+ Object messageArgExpression3 )
+ {
+ this( expression, new Object[]{ messageArgExpression1, messageArgExpression2, messageArgExpression3 } );
}
private static Object[] prefixArgs( Object[] messageArgExpressions )
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FacesBackingBean.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FacesBackingBean.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FacesBackingBean.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FacesBackingBean.java Sat May 14 22:29:26 2005
@@ -33,6 +33,20 @@
import java.util.Collections;
import java.lang.reflect.Field;
+/**
+ * <p>
+ * A JavaServer Faces backing bean. An instance of this class will be created whenever a corresponding JSF path is
+ * requested (e.g., an instance of foo.MyPage will be created for the webapp-relative path "/foo/MyPage.faces"). The
+ * instance will be released (removed from the user session) when a non-matching path is requested. A faces backing
+ * bean can hold component references and event/command handlers, and it can raise actions with normal JSF command event
+ * handlers that are annotated with {@link org.apache.beehive.netui.pageflow.annotations.Jpf.CommandHandler @Jpf.CommandHandler}.
+ * The bean instance can be bound to with a JSF-style expression like <code>#{backing.myComponent}</code>.
+ * </p>
+ * <p>
+ * JSF backing beans are configured using the
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.FacesBacking @Jpf.FacesBacking} annotation.
+ * </p>
+ */
public abstract class FacesBackingBean
extends PageFlowManagedObject
{
@@ -42,18 +56,33 @@
private Map _pageInputs;
+ /**
+ * 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 )
{
HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
ScopedServletUtils.setScopedSessionAttr( InternalConstants.FACES_BACKING_ATTR, this, unwrappedRequest );
}
+ /**
+ * Remove this instance from the session.
+ */
protected void removeFromSession( HttpServletRequest request )
{
HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
ScopedServletUtils.removeScopedSessionAttr( InternalConstants.FACES_BACKING_ATTR, unwrappedRequest );
}
+ /**
+ * 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. 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 )
{
HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
@@ -63,11 +92,17 @@
AdapterManager.getServletContainerAdapter( servletContext ).ensureFailover( attr, this, unwrappedRequest );
}
+ /**
+ * Get the display name for the bean. For FacesBackingBeans, this is simply the class name.
+ */
public String getDisplayName()
{
return getClass().getName();
}
+ /**
+ * Reinitialize the bean for a new request. Used by the framework; normally should not be called directly.
+ */
public void reinitialize( HttpServletRequest request, HttpServletResponse response, ServletContext servletContext )
{
super.reinitialize( request, response, servletContext );
@@ -125,11 +160,22 @@
}
}
+ /**
+ * Get a page input that was passed from a Page Flow action as an "action output".
+ *
+ * @param pageInputName the name of the page input. This is the same as the name of the "action output".
+ * @return the value of the page input, or <code>null</code> if the given one does not exist.
+ */
protected Object getPageInput( String pageInputName )
{
return _pageInputs != null ? _pageInputs.get( pageInputName ) : null;
}
+ /**
+ * Get the map of all page inputs that was passed from a Page Flow action as "action outputs".
+ *
+ * @return a Map of page-input-name (String) to page-input-value (Object).
+ */
public Map getPageInputMap()
{
return _pageInputs;
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Factory.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Factory.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Factory.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Factory.java Sat May 14 22:29:26 2005
@@ -19,6 +19,9 @@
import javax.servlet.ServletContext;
+/**
+ * Base class for ServletContext-scoped factories.
+ */
public abstract class Factory
{
private ServletContext _servletContext;
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java Sat May 14 22:29:26 2005
@@ -17,50 +17,48 @@
*/
package org.apache.beehive.netui.pageflow;
-import org.apache.beehive.netui.util.internal.InternalStringBuilder;
-
import org.apache.beehive.netui.core.urls.MutableURI;
import org.apache.beehive.netui.pageflow.config.PageFlowActionMapping;
-import org.apache.beehive.netui.pageflow.internal.InternalUtils;
-import org.apache.beehive.netui.pageflow.internal.InternalExpressionUtils;
-import org.apache.beehive.netui.pageflow.internal.AdapterManager;
-import org.apache.beehive.netui.pageflow.internal.InternalConstants;
-import org.apache.beehive.netui.pageflow.handler.LoginHandler;
+import org.apache.beehive.netui.pageflow.handler.ActionForwardHandler;
import org.apache.beehive.netui.pageflow.handler.ExceptionsHandler;
-import org.apache.beehive.netui.pageflow.handler.Handlers;
import org.apache.beehive.netui.pageflow.handler.FlowControllerHandlerContext;
-import org.apache.beehive.netui.pageflow.handler.ActionForwardHandler;
+import org.apache.beehive.netui.pageflow.handler.Handlers;
+import org.apache.beehive.netui.pageflow.handler.LoginHandler;
+import org.apache.beehive.netui.pageflow.internal.AdapterManager;
+import org.apache.beehive.netui.pageflow.internal.InternalConstants;
+import org.apache.beehive.netui.pageflow.internal.InternalExpressionUtils;
+import org.apache.beehive.netui.pageflow.internal.InternalUtils;
import org.apache.beehive.netui.pageflow.scoping.ScopedRequest;
import org.apache.beehive.netui.util.internal.FileUtils;
+import org.apache.beehive.netui.util.internal.InternalStringBuilder;
import org.apache.beehive.netui.util.internal.cache.ClassLevelCache;
import org.apache.beehive.netui.util.logging.Logger;
import org.apache.struts.Globals;
-import org.apache.struts.util.TokenProcessor;
-import org.apache.struts.util.MessageResources;
-import org.apache.struts.util.RequestUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
-import org.apache.struts.action.ActionServlet;
+import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
+import org.apache.struts.action.ActionServlet;
import org.apache.struts.action.RequestProcessor;
-import org.apache.struts.action.ActionMessage;
import org.apache.struts.config.ActionConfig;
-import org.apache.struts.config.ModuleConfig;
import org.apache.struts.config.ControllerConfig;
+import org.apache.struts.config.ModuleConfig;
+import org.apache.struts.util.MessageResources;
+import org.apache.struts.util.RequestUtils;
+import org.apache.struts.util.TokenProcessor;
import javax.security.auth.login.LoginException;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
-import javax.servlet.jsp.el.ELException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.sql.DataSource;
import java.io.IOException;
-import java.lang.reflect.Method;
-import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Iterator;
@@ -102,8 +100,6 @@
* is in the ServletContext attribute {@link Globals#ACTION_SERVLET_KEY}.
*/
protected transient ActionServlet servlet = null;
-
-
static class PerRequestState
@@ -163,6 +159,9 @@
{
}
+ /**
+ * 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 )
{
//
@@ -190,8 +189,7 @@
}
/**
- * Log out the current user. This causes the user to be removed from Servlet
- * Session (on all single-signon webapps) as well as from the thread.
+ * Log out the current user.
*
* @param invalidateSessions if true, the session is invalidated (on all single-signon webapps);
* otherwise the session and its data are left intact (except for authentication
@@ -320,7 +318,7 @@
}
/**
- * @exclude
+ * An internal method for executing an action; should not be invoked directly.
*/
protected ActionForward internalExecute( ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response )
@@ -329,6 +327,7 @@
ServletContainerAdapter sca = AdapterManager.getServletContainerAdapter( getServletContext() );
PageFlowEventReporter eventReporter = sca.getEventReporter();
eventReporter.actionRaised( this, mapping, form, request, response );
+ long startTime = System.currentTimeMillis();
//
// If we handled an exception in onCreate, just forward to the result of that.
@@ -427,7 +426,8 @@
}
ActionForward ret = forwardTo( retVal, mapping, request, response, actionName, null, form, servletContext );
- eventReporter.actionSuccess( this, mapping, form, request, response, ret );
+ long timeTaken = System.currentTimeMillis() - startTime;
+ eventReporter.actionSuccess( this, mapping, form, request, response, ret, timeTaken );
return ret;
}
catch ( Exception e )
@@ -503,6 +503,9 @@
}
}
+ /**
+ * 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 )
{
@@ -538,6 +541,10 @@
er.flowControllerCreated( this, request, response );
}
+ /**
+ * 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(); // for backwards compatiblity
@@ -560,16 +567,16 @@
/**
* Get the Struts module path for this controller.
*
- * @return a String that is the Struts module path for this controller - the parent directory
- * for a {@link PageFlowController} and "/-global" for Global.app.
+ * @return a String that is the Struts module path for this controller.
*/
public abstract String getModulePath();
/**
* Callback that occurs before any user action method is invoked. {@link FlowController#getRequest},
- * {@link FlowController#getResponse}, {@link FlowController#getSession}, and {@link FlowController#getActionMapping} may all be used
- * during this method. The action to be run can be discovered by calling
- * {@link ActionMapping#getPath} on the value returned from {@link FlowController#getActionMapping}.
+ * {@link FlowController#getResponse}, {@link FlowController#getSession}, and
+ * {@link FlowController#getActionMapping} may all be used during this method. The action to be run can be
+ * discovered by calling {@link ActionMapping#getPath} on the value returned from
+ * {@link FlowController#getActionMapping}.
*/
protected synchronized void beforeAction()
throws Exception
@@ -578,9 +585,10 @@
/**
* Callback that occurs after any user action method is invoked. {@link FlowController#getRequest},
- * {@link FlowController#getResponse}, {@link FlowController#getSession}, and {@link FlowController#getActionMapping} may all be used
- * during this method. The action that was run can be discovered by calling
- * {@link ActionMapping#getPath} on the value returned from {@link FlowController#getActionMapping}.
+ * {@link FlowController#getResponse}, {@link FlowController#getSession}, and
+ * {@link FlowController#getActionMapping} may all be used during this method. The action that was run can be
+ * discovered by calling {@link ActionMapping#getPath} on the value returned from
+ * {@link FlowController#getActionMapping}.
*/
protected synchronized void afterAction()
throws Exception
@@ -597,12 +605,11 @@
}
/**
- * Callback that is invoked when this controller instance is "destroyed", i.e., removed from the
- * user session. {@link FlowController#getRequest}, {@link FlowController#getResponse}, and {@link FlowController#getActionMapping} may <i>not</i>
- * be used during this method, since it may be called due to session termination outside of a
+ * Callback that is invoked when this controller instance is "destroyed", i.e., removed from the user session.
+ * {@link FlowController#getRequest}, {@link FlowController#getResponse}, and {@link FlowController#getActionMapping}
+ * may <i>not</i> be used during this method, since it may be called due to session termination outside of a
* request. {@link FlowController#getSession} also may not be used, but the session is passed as an argument
- * to {@link FlowController#onDestroy(HttpSession)}, which should be used in place of this
- * method.
+ * to {@link FlowController#onDestroy(HttpSession)}, which should be used in place of this method.
* <br>
* Note that this method is <strong>not synchronized</strong>. It is dangerous to synchronize your override of
* this method because it is invoked during a callback from the Servlet container. Depending on the container,
@@ -615,9 +622,9 @@
}
/**
- * Callback that is invoked when this controller instance is "destroyed", i.e., removed from the
- * user session. {@link FlowController#getRequest}, {@link FlowController#getResponse}, and {@link FlowController#getActionMapping} may <i>not</i>
- * be used during this method, since it may be called due to session termination outside of a
+ * Callback that is invoked when this controller instance is "destroyed", i.e., removed from the user session.
+ * {@link FlowController#getRequest}, {@link FlowController#getResponse}, and {@link FlowController#getActionMapping}
+ * may <i>not</i> be used during this method, since it may be called due to session termination outside of a
* request. {@link FlowController#getSession} also may not be used, but the session is passed as an argument.
* <br>
* Note that this method is <strong>not synchronized</strong>. It is dangerous to synchronize your override of
@@ -635,8 +642,8 @@
public abstract PreviousPageInfo getPreviousPageInfoLegacy( PageFlowController curJpf, HttpServletRequest request );
/**
- * Get an action handler method of the given name/signature
- * .
+ * Get an action handler method of the given name/signature.
+ *
* @param methodName the name of the action handler method to query.
* @param argType the type of the argument to the action handler method; if <code>null</code>,
* the method takes no arguments.
@@ -949,7 +956,7 @@
}
/**
- * @exclude
+ * Get the Struts ModuleConfig object associated with this FlowController.
*/
public final ModuleConfig getModuleConfig()
{
@@ -1138,8 +1145,8 @@
}
/**
- * Called on this object for non-lookup (refresh) requests.
- * @exclude
+ * Called on this object for non-lookup (refresh) requests. This is a framework-invoked method that should not
+ * normally be called directly.
*/
public final synchronized void refresh( HttpServletRequest request, HttpServletResponse response )
{
@@ -1156,9 +1163,9 @@
}
/**
- * Callback that is invoked when this controller is involved in a refresh request, as can happen
- * in a portal environment on a request where no action is run in the current page flow, but
- * a previously-displayed JSP in the page flow is re-rendered.
+ * Callback that is invoked when this controller is involved in a refresh request, as can happen in a portal
+ * environment on a request where no action is run in the current page flow, but a previously-displayed page in the
+ * page flow is re-rendered.
*/
protected void onRefresh()
{
@@ -1181,8 +1188,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,
@@ -1191,19 +1198,20 @@
}
/**
- * When this FlowController does not use a {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward} annotation with a
- * <code>navigateTo</code>={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousAction} attribute, the following methods always return
- * <code>null</code> by default.
+ * When this FlowController does not use a {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward}
+ * annotation with a
+ * <code>navigateTo=</code>{@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousAction Jpf.NavigateTo.previousAction}
+ * attribute, the following methods always return <code>null</code> by default.
* <ul>
* <li>getPreviousActionInfo</li>
* <li>getPreviousActionURI</li>
* <li>getPreviousForm</li>
* </ul>
- * Override <code>alwaysTrackPreviousAction</code> (which always returns <code>false</code>)
- * to enable these methods in all cases.
+ * Override <code>alwaysTrackPreviousAction</code> (which always returns <code>false</code>) to enable these methods
+ * in all cases.
*
- * @return <code>true</code> if the previous action should always be tracked, regardless
- * of whether <code>return-to="previousAction"</code> is used.
+ * @return <code>true</code> if the previous action should always be tracked, regardless of whether
+ * <code>return-to="previousAction"</code> is used.
* @see PageFlowController#getPreviousActionInfo
* @see PageFlowController#getPreviousActionURI
* @see PageFlowController#getPreviousFormBean
@@ -1214,18 +1222,20 @@
}
/**
- * When this FlowController does not use a {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward} annotation with either a
- * <code>navigateTo</code>={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#currentPage} attribute or a
- * <code>navigateTo</code>={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousPage} attribute, the following methods always return
- * <code>null</code> by default.
+ * When this FlowController does not use a {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward}
+ * annotation with either a
+ * <code>navigateTo</code>={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#currentPage Jpf.NavigateTo.currentPage}
+ * attribute or a
+ * <code>navigateTo</code>={@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousPage Jpf.NavigateTo.previousPage}
+ * attribute, the following methods always return <code>null</code> by default.
* <ul>
* <li>getCurrentPageInfo</li>
* <li>getPreviousPageInfo</li>
* <li>getCurrentForwardPath</li>
* <li>getPreviousForwardPath</li>
* </ul>
- * Override <code>alwaysTrackPreviousPage</code> (which always returns <code>false</code>)
- * to enable these methods in all cases.
+ * Override <code>alwaysTrackPreviousPage</code> (which always returns <code>false</code>) to enable these methods
+ * in all cases.
*
* @return <code>true</code> if the previous page should always be tracked, regardless
* of whether <code>return-to="currentPage"</code> or <code>return-to="previousPage"</code>
@@ -1309,14 +1319,13 @@
}
/**
- * Invoke the given exception handler method.
- * @exclude
+ * Invoke the given exception handler method. This is a framework-invoked method that should not normally be called
+ * directly
*
* @param method the action handler method to invoke.
* @param ex the Throwable that is to be handled.
* @param message the String message that is to be passed to the handler method.
- * @param formBean the form bean that is associated with the action being processed; may be
- * <code>null</code>.
+ * @param formBean the form bean that is associated with the action being processed; may be <code>null</code>.
* @param request the current HttpServletRequest.
* @param response the current HttpServletResponse.
* @param readonly if <code>true</code>, session failover will not be triggered after invoking the method.
@@ -1607,7 +1616,7 @@
*
* @param request the current request.
* @param key The bundle key specified in a
- * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.MessageBundle} annotation.
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.MessageBundle @Jpf.MessageBundle} annotation.
*/
protected MessageResources getResources( HttpServletRequest request, String key )
{
@@ -1625,7 +1634,8 @@
/**
* Get the specified message resources for this FlowController.
*
- * @param key The bundle key specified in a {@link org.apache.beehive.netui.pageflow.annotations.Jpf.MessageBundle} annotation.
+ * @param key The bundle key specified in a
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.MessageBundle @Jpf.MessageBundle} annotation.
*/
protected MessageResources getMessageResources( String key )
{
@@ -1896,8 +1906,8 @@
}
/**
- * Get the flow-scoped form bean member associated with the given ActionMapping.
- * @exclude
+ * Get the flow-scoped form bean member associated with the given ActionMapping. This is a framework-invoked
+ * method that should not normally be called directly.
*/
public ActionForm getFormBean( ActionMapping mapping )
{
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowControllerFactory.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowControllerFactory.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowControllerFactory.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowControllerFactory.java Sat May 14 22:29:26 2005
@@ -369,7 +369,7 @@
/**
* Get the map of shared flows for the given request. The map is derived from the shared flows
* that are declared (through the <code>sharedFlowRefs</code> attribute of
- * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller}) in the page flow for the request.
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller @Jpf.Controller}) in the page flow for the request.
*
* @param context a {@link RequestContext} object which contains the current request and response.
* @return a Map of shared-flow-name (String) to {@link SharedFlowController}.
@@ -387,7 +387,7 @@
/**
* Get the map of shared flows for the given path. The map is derived from the shared flows
* that are declared (through the <code>sharedFlowRefs</code> attribute of
- * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller}) in the page flow for the path.
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller @Jpf.Controller}) in the page flow for the path.
*
* @param context a {@link RequestContext} object which contains the current request and response.
* @param path a <strong>webapp-relative</strong> path. The path should not contain the webapp context path.
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FormData.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FormData.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FormData.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FormData.java Sat May 14 22:29:26 2005
@@ -45,15 +45,16 @@
/**
- * Base class for form beans associated with action methods in {@link PageFlowController}s.
+ * Base class for form beans associated with action methods in {@link PageFlowController}s. Note that Page Flow actions
+ * may take form beans of any type.
*/
public class FormData extends ValidatorForm
{
private static final Logger _log = Logger.getInstance( FormData.class );
//
- // This is used to allow us to run against Validator 1.0 or 1.1. The Method is only used when running
- // against Validator 1.0.
+ // This is used to allow us to run against Validator 1.0 or 1.1. The reflective Method is only used when running
+ // against Validator 1.0 (legacy).
//
private static Method _legacyInitValidatorMethod = null;
@@ -115,6 +116,16 @@
}
}
+ /**
+ * Run all validation (declarative validation from annotations and the result of {@link Validatable#validate}) on
+ * a given bean.
+ *
+ * @param bean the bean to validate.
+ * @param beanName the name of the bean, to be passed to Validator to look up declarative validation rules.
+ * @param mapping the current ActionMapping.
+ * @param request the current HttpServletRequest.
+ * @return an ActionErrors object containing errors that occurred during bean validation.
+ */
protected ActionErrors validateBean( Object bean, String beanName, ActionMapping mapping, HttpServletRequest request )
{
MessageResources messageResources = ( MessageResources ) request.getAttribute( Globals.MESSAGES_KEY );
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Forward.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Forward.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Forward.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Forward.java Sat May 14 22:29:26 2005
@@ -47,7 +47,8 @@
/**
* An object of this type is returned from an action methods in a {@link PageFlowController} to
* determine the next URI to be displayed. It is constructed on the name of a forward defined
- * by the @{@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward} annotation, and resolves to the URI specified in that forward.
+ * by the @{@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward} annotation, and resolves to the URI
+ * specified in that forward.
*/
public class Forward extends ActionForward
{
@@ -148,11 +149,13 @@
}
/**
- * Constructor which accepts the name of a forward defined by the <code>@{@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward}</code>
+ * Constructor which accepts the name of a forward defined by the
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward}
* annotation. The values returned from {@link #getPath}, {@link #getRedirect} and
* {@link #contextRelative} are resolved from this forward.
*
- * @param forwardName the name of the forward (<code>@{@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward}</code>) to resolve.
+ * @param forwardName the name of the forward
+ * ({@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward}) to resolve.
*/
public Forward( String forwardName )
{
@@ -160,12 +163,14 @@
}
/**
- * Constructor which accepts the name of a forward defined by the <code>@{@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward}</code>
+ * Constructor which accepts the name of a forward defined by the
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward}
* annotation. The values returned from {@link #getPath}, {@link #getRedirect} and
* {@link #contextRelative} are resolved from this forward. Also accepts a form bean
* to make available in the request (or user session, as appropriate).
*
- * @param forwardName the name of the forward (<code>@{@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward}</code>) to resolve.
+ * @param forwardName the name of the forward
+ * ({@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward}) to resolve.
* @param outputFormBean a form bean instance to make available in the request (or user session, as appropriate).
* See {@link #addOutputForm} for details about how this manifests itself.
*/
@@ -180,12 +185,14 @@
}
/**
- * Constructor which accepts the name of a forward defined by the <code>@{@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward}</code>
+ * Constructor which accepts the name of a forward defined by the
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward}
* annotation. The values returned from {@link #getPath}, {@link #getRedirect} and
* {@link #contextRelative} are resolved from this forward. Also accepts a named action output
* to make available in the request, through {@link PageFlowUtils#getActionOutput}..
*
- * @param forwardName the name of the forward (<code>@{@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward}</code>) to resolve.
+ * @param forwardName the name of the forward
+ * ({@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward}) to resolve.
* @param actionOutputName the name of a action output to make available in the request.
* @param actionOutputValue the action output object to make available in the request.
*/
@@ -362,7 +369,7 @@
* conditions is met:
* <ul>
* <li>the name around which this object was constructed resolves to a path defined
- * by a <code>@{@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward}</code>, or</li>
+ * by a {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward}, or</li>
* <li>this object was constructed around an explicit path, by
* {@link #Forward(URI)} or {@link #Forward(URL)}.</li>
* </ul>
@@ -720,9 +727,9 @@
/**
* Tell whether this Forward was configured explicitly (through
- * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward#redirect}, {@link #setRedirect}), or
- * {@link #Forward(URI, boolean)}) to perform a redirect. Otherwise, a redirect is implied by a URI that does not
- * resolve to the current server.
+ * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward#redirect @Jpf.Forward(redirect=...)},
+ * {@link #setRedirect}, or {@link #Forward(URI, boolean)}) to perform a redirect. Otherwise, a redirect is
+ * implied by a URI that does not resolve to the current server.
*/
public boolean hasExplicitRedirectValue()
{
@@ -731,7 +738,7 @@
/**
* Get the URI path associated with this object. Resolve it from the name of a forward
- * (<code>@{@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward}</code>) if necessary.
+ * ({@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward}) if necessary.
*
* @return a String that is the URI path.
* @see #Forward(String)
@@ -804,8 +811,12 @@
}
/**
- * Tell whether this Forward will store the original query string on the page restored through
- * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.NavigateTo#previousAction}.
+ * Tell whether this Forward will store the original query string on the page restored when 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 Jpf.NavigateTo.previousAction}
+ * </code> is used.
*/
public boolean doesRestoreQueryString()
{
Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/GlobalApp.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/GlobalApp.java?rev=170197&r1=170196&r2=170197&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/GlobalApp.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/GlobalApp.java Sat May 14 22:29:26 2005
@@ -29,7 +29,7 @@
/**
* Base class for user-defined global state and fallback controller logic. A specific instance of
- * this class (based on the Global.app source file in /WEB-INF/src/global) is created and stored in
+ * this class (based on the Global.app/Global.java source file in the "global" package) is created and stored in
* the user session before any {@link PageFlowController} is created, and unless it is explicitly
* removed from the session, it is not freed until the session is invalidated.
* <p>
@@ -38,10 +38,9 @@
* Uncaught exceptions also bubble through the GlobalApp instance, which has a chance to catch
* them.
* <p>
- * Data in the current GlobalApp instance can be accessed by databinding tags using the
- * <code>globalApp</code> scope.
+ * Data in the current GlobalApp instance can be accessed by databinding tags using the <code>globalApp</code> scope.
*
- * @deprecated Use {@link SharedFlowController} instead.
+ * @deprecated Use a {@link SharedFlowController} instead.
* @see PageFlowController
*/
public class GlobalApp
@@ -69,6 +68,9 @@
return false;
}
+ /**
+ * Store information about the most recent action invocation.
+ */
void savePreviousActionInfo( ActionForm form, HttpServletRequest request, ActionMapping mapping,
ServletContext servletContext )
{