Author: rich
Date: Tue Apr 26 08:28:53 2005
New Revision: 164802
URL: http://svn.apache.org/viewcvs?rev=164802&view=rev
Log:
Fix for http://issues.apache.org/jira/browse/BEEHIVE-562 : Expressions are not
evaluated in message arguments in declarative validation on external form beans
Also cleaned up some TODOs that didn't require code changes.
tests: bvt in netui (WinXP)
BB: self (linux)
Added:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/ExpressionAwareMessageResources.java
(with props)
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/Bean1.java
(with props)
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/Bean2.java
(with props)
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/BeanMessages.properties
(with props)
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/PageFlowMessages.properties
(with props)
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/validation/validateExternalBean/
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/validation/validateExternalBean/Controller.jpf
(with props)
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/validation/validateExternalBean/index.jsp
(with props)
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/validation/validateExternalBean/messagesFromBean.jsp
(with props)
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/validation/validateExternalBean/messagesFromPageFlow.jsp
(with props)
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/validation/validateExternalBean/success.jsp
(with props)
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/ValidateExternalBean.xml
(with props)
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/ValidateExternalBeanWithMessages.xml
(with props)
Modified:
incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/CompilerUtils.java
incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/grammar/SimpleActionGrammar.java
incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/validation/ValidatableField.java
incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/validation/ValidatableFieldOld.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/ExpressionMessage.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/FormData.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/PageFlowUtils.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/interceptor/Interceptor.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/InternalExpressionUtils.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedResponseImpl.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Error.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ErrorBaseTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Errors.java
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/errors/errorsController.jpf
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/validation/argExpressions/Controller.jpf
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
Modified:
incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/CompilerUtils.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/CompilerUtils.java?rev=164802&r1=164801&r2=164802&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/CompilerUtils.java
(original)
+++
incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/CompilerUtils.java
Tue Apr 26 08:28:53 2005
@@ -313,17 +313,6 @@
private static void getValues( AnnotationValue arrayValue, List
translatedValues, boolean weedOutErrorType )
{
- /* TODO: uncomment the following method implementation after CR188654
is fixed
- List values = ( List ) arrayValue.getValue();
-
- for ( Iterator ii = values.iterator(); ii.hasNext(); )
- {
- AnnotationValue i = ( AnnotationValue ) ii.next();
- Object value = i.getValue();
- if ( ! weedOutErrorType || ! ERROR_TYPE_STR.equals( value ) )
translatedValues.add( value );
- }
- */
-
List values = ( List ) arrayValue.getValue();
for ( Iterator ii = values.iterator(); ii.hasNext(); )
{
@@ -739,13 +728,6 @@
public static String getLoadableName( DeclaredType jclass )
{
return getLoadableName( getDeclaration( jclass ) );
- }
-
- /** @deprecated */
- // TODO: remove this method once we're sure it's not being used.
- public static File getOriginalFile( TypeDeclaration decl )
- {
- return getSourceFile( decl, true );
}
public static File getSourceFile( TypeDeclaration decl, boolean
mustBeNonNull )
Modified:
incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java?rev=164802&r1=164801&r2=164802&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
(original)
+++
incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
Tue Apr 26 08:28:53 2005
@@ -107,9 +107,7 @@
setMultipartHandler( mca.getMultipartHandler() );
GenForwardModel.addForwards( mca.getForwards(), this, _jclass,
this, null );
- // TODO: this is a *temporary* workaround for
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5090006.
- // When this bug is fixed, we can uncomment the @Jpf.Controller
annotation in FlowController.java, and
- // remove the following line:
+ // TODO: comment
addForward( new ForwardModel( "_auto", "", this ) );
GenExceptionModel.addCatches( mca.getCatches(), this, _jclass,
this, this );
@@ -312,7 +310,7 @@
}
MessageResourcesModel mrm = new MessageResourcesModel(
this );
- String key = "formMessages:" +
CompilerUtils.getLoadableName( formClassDecl ); // TODO: constant
+ String key = "formMessages:" +
CompilerUtils.getLoadableName( formClassDecl );
mrm.setKey( key );
mrm.setParameter( defaultMessageResources );
mrm.setReturnNull( true );
@@ -438,9 +436,9 @@
try
{
//
- // @TODO this appears to be the only way to predict whether the
file can actually be
+ // This appears to be the only way to predict whether the file can
actually be
// written to; it may be that canWrite() returns true, but the
file permissions
- // (NTFS only?) will cause an exception to be thrown. But is this
worth the cost?
+ // (NTFS only?) will cause an exception to be thrown.
//
new FileOutputStream( _strutsConfigFile, true ).close();
}
Modified:
incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/grammar/SimpleActionGrammar.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/grammar/SimpleActionGrammar.java?rev=164802&r1=164801&r2=164802&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/grammar/SimpleActionGrammar.java
(original)
+++
incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/grammar/SimpleActionGrammar.java
Tue Apr 26 08:28:53 2005
@@ -166,9 +166,7 @@
if ( forwardName.equals( CompilerUtils.getString( forwardAnn,
NAME_ATTR, true ) ) ) return null;
}
- // TODO: this is a *temporary* workaround for
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5090006.
- // When this bug is fixed, we can uncomment the @Jpf.Controller
annotation in FlowController.java, and
- // remove the following line:
+ // TODO: comment
if ( forwardName.equals( "_auto" ) ) return null;
addError( member, "error.unresolvable-global-forward", forwardName
);
Modified:
incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/validation/ValidatableField.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/validation/ValidatableField.java?rev=164802&r1=164801&r2=164802&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/validation/ValidatableField.java
(original)
+++
incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/validation/ValidatableField.java
Tue Apr 26 08:28:53 2005
@@ -132,7 +132,7 @@
if ( _displayName != null )
{
displayName = ValidatorConstants.EXPRESSION_KEY_PREFIX +
_displayName;
- displayNameIsResource = false;
+ displayNameIsResource = true;
}
else if ( _displayNameKey != null )
{
@@ -297,7 +297,7 @@
// Add our special constant as the message key, append the
hardcoded message to it.
//
msgElementToUse.setKey(
ValidatorConstants.EXPRESSION_KEY_PREFIX + message );
- msgElementToUse.setResource( Boolean.FALSE.toString() );
+ msgElementToUse.setResource( Boolean.TRUE.toString() );
}
}
}
@@ -341,8 +341,7 @@
String argMessage = arg.getMessage();
String key = arg.isKey() ? argMessage :
ValidatorConstants.EXPRESSION_KEY_PREFIX + argMessage;
argElementToUse.setKey( key );
- String isResource = Boolean.toString( arg.isKey() );
- argElementToUse.setResource( isResource );
+ argElementToUse.setResource( Boolean.TRUE.toString() );
String bundle = rule.getBundle();
if ( arg.isKey() && bundle != null && bundle.length() > 0 )
{
Modified:
incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/validation/ValidatableFieldOld.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/validation/ValidatableFieldOld.java?rev=164802&r1=164801&r2=164802&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/validation/ValidatableFieldOld.java
(original)
+++
incubator/beehive/trunk/netui/src/compiler-core/org/apache/beehive/netui/compiler/model/validation/ValidatableFieldOld.java
Tue Apr 26 08:28:53 2005
@@ -98,7 +98,7 @@
// Add our special constant as the message key, append the
hardcoded message to it.
//
msgElementToUse.setKey(
ValidatorConstants.EXPRESSION_KEY_PREFIX + message );
- msgElementToUse.setResource( Boolean.FALSE.toString() );
+ msgElementToUse.setResource( Boolean.TRUE.toString() );
}
}
}
@@ -144,7 +144,7 @@
String argMessage = arg.getMessage();
String key = arg.isKey() ? argMessage :
ValidatorConstants.EXPRESSION_KEY_PREFIX + argMessage;
argElementToUseClass.getMethod( "setKey", new Class[]{
String.class } ).invoke( argElementToUse, new Object[]{ key } );
- String isResource = Boolean.toString( arg.isKey() );
+ String isResource = Boolean.TRUE.toString();
argElementToUseClass.getMethod( "setResource", new
Class[]{ String.class } ).invoke( argElementToUse, new Object[]{ isResource } );
argElementToUseClass.getMethod( "setName", new Class[]{
String.class } ).invoke( argElementToUse, new Object[]{ ruleName } );
}
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=164802&r1=164801&r2=164802&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
Tue Apr 26 08:28:53 2005
@@ -600,9 +600,8 @@
//
// Try to select the appropriate Struts module and delegate to its
RequestProcessor.
//
- RequestUtils.selectModule( modulePath, request, servletContext );
- ModuleConfig appConfig = getModuleConfig( request );
- RequestProcessor requestProcessor = getRequestProcessor( appConfig
);
+ ModuleConfig moduleConfig = InternalUtils.selectModule(
modulePath, request, servletContext );
+ RequestProcessor requestProcessor = getRequestProcessor(
moduleConfig );
requestProcessor.process( request, response );
}
else
@@ -615,8 +614,8 @@
if ( InternalUtils.getModuleConfig( RequestUtils.getModuleName(
request, servletContext ), servletContext ) != null )
{
- RequestUtils.selectModule( request, servletContext );
- moduleConfig = getModuleConfig( request );
+ String modulePrefix = RequestUtils.getModuleName( request,
servletContext );
+ moduleConfig = InternalUtils.selectModule( modulePrefix,
request, servletContext );
}
String servletPath = InternalUtils.getDecodedServletPath( request
);
@@ -676,7 +675,7 @@
{
if ( getModuleConfig( modulePath, request, response ) != null )
{
- RequestUtils.selectModule( modulePath, request,
getServletContext() );
+ InternalUtils.selectModule( modulePath, request,
getServletContext() );
}
}
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=164802&r1=164801&r2=164802&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
Tue Apr 26 08:28:53 2005
@@ -19,27 +19,48 @@
import org.apache.struts.action.ActionMessage;
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.util.logging.Logger;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+
+// TODO comment this class
public class ExpressionMessage
extends ActionMessage
{
+ private static final Logger _log = Logger.getInstance(
ExpressionMessage.class );
+
public ExpressionMessage( String expression, Object[] messageArgs )
{
- super( InternalConstants.MESSAGE_IS_EXPRESSION_PREFIX + expression,
expressionizeArgs( messageArgs ) );
+ super( InternalConstants.MESSAGE_IS_EXPRESSION_PREFIX + expression,
messageArgs );
}
- public void setExpression( String expression )
+ public ExpressionMessage( String expression, Object[]
messageArgExpressions, Object formBean,
+ HttpServletRequest request )
{
- key = InternalConstants.MESSAGE_IS_EXPRESSION_PREFIX + expression;
+ super( InternalConstants.MESSAGE_IS_EXPRESSION_PREFIX + expression,
+ evaluateArgs( messageArgExpressions, formBean, request,
InternalUtils.getServletContext( request ) ) );
}
- private static Object[] expressionizeArgs( Object[] args )
+ private static Object[] evaluateArgs( Object[] args, Object formBean,
HttpServletRequest request,
+ ServletContext servletContext )
{
if ( args == null ) return null;
for ( int i = 0; i < args.length; i++ )
- {
- args[i] = InternalConstants.MESSAGE_IS_EXPRESSION_PREFIX + args[i];
+ {
+ String argStr = args[i].toString();
+
+ try
+ {
+ args[i] = InternalExpressionUtils.evaluateMessage( argStr,
formBean, request, servletContext );
+ }
+ catch ( Exception e )
+ {
+ _log.error( "Could not evaluate message expression " + argStr,
e );
+ }
}
return args;
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=164802&r1=164801&r2=164802&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
Tue Apr 26 08:28:53 2005
@@ -72,15 +72,6 @@
/**
* Base class for user-written flow controllers - [EMAIL PROTECTED]
PageFlowController}s and [EMAIL PROTECTED] SharedFlowController}s.
*/
-/*
- * TODO: this annotation can't be enabled until we move onto JDK1.5.0_01,
which fixes
- * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5090006
[EMAIL PROTECTED](
- forwards={
- @Jpf.Forward(name=PageFlowConstants.AUTO_VIEW_RENDER_FORWARD_NAME,
path="")
- }
-)
-*/
public abstract class FlowController extends PageFlowManagedObject
implements PageFlowConstants, ActionResolver
{
@@ -1418,7 +1409,7 @@
* @param messageKey the message-resources key for the message.
* @param messageArgs zero or more arguments to the message.
*/
- public void addActionError( String propertyName, String messageKey,
Object[] messageArgs )
+ protected void addActionError( String propertyName, String messageKey,
Object[] messageArgs )
{
InternalUtils.addActionError( propertyName, new ActionMessage(
messageKey, messageArgs ), getRequest() );
}
@@ -1428,11 +1419,11 @@
*
* @param propertyName the name of the property with which to associate
this error.
* @param expression the expression that will be evaluated to generate the
error message.
- * @param messageArgs zero or more arguments to the message.
+ * @param messageArgs zero or more arguments to the message; may be
expressions.
*/
- public void addActionErrorExpression( String propertyName, String
expression, Object[] messageArgs )
+ protected void addActionErrorExpression( String propertyName, String
expression, Object[] messageArgs )
{
- InternalUtils.addActionError( propertyName, new ExpressionMessage(
expression, messageArgs ), getRequest() );
+ PageFlowUtils.addActionErrorExpression( getRequest(), propertyName,
expression, messageArgs );
}
/**
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=164802&r1=164801&r2=164802&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
Tue Apr 26 08:28:53 2005
@@ -21,16 +21,27 @@
import org.apache.struts.validator.Resources;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
+import org.apache.struts.util.MessageResources;
+import org.apache.struts.util.MessageResourcesFactory;
+import org.apache.struts.config.ModuleConfig;
+import org.apache.struts.Globals;
import org.apache.commons.validator.Validator;
import org.apache.commons.validator.ValidatorException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.ServletContext;
+import javax.servlet.ServletRequest;
import org.apache.beehive.netui.util.logging.Logger;
+import org.apache.beehive.netui.pageflow.config.PageFlowActionMapping;
+import org.apache.beehive.netui.pageflow.internal.InternalExpressionUtils;
+import org.apache.beehive.netui.pageflow.internal.InternalConstants;
+import
org.apache.beehive.netui.pageflow.internal.ExpressionAwareMessageResources;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
+import java.util.Locale;
+import java.util.HashMap;
/**
@@ -80,9 +91,72 @@
return validateBean( this, mapping.getAttribute(), mapping, request );
}
- protected ActionErrors validateBean( Object bean, String beanName,
ActionMapping mapping, HttpServletRequest request )
+ /**
+ * MessageResources that conglomerates a primary and backup
MessageResources.
+ */
+ private static class MergedMessageResources
+ extends MessageResources
{
+ private MessageResources _primary;
+ private MessageResources _backup;
+
+ public MergedMessageResources( MessageResources primary,
MessageResources backup )
+ {
+ super( primary.getFactory(), primary.getConfig(),
primary.getReturnNull() );
+ _primary = primary;
+ _backup = backup;
+ }
+ public String getMessage( Locale locale, String key )
+ {
+ String message = _primary.getMessage( locale, key );
+ if ( message == null ) message = _backup.getMessage( locale, key );
+ return message;
+ }
+ }
+
+ protected ActionErrors validateBean( Object bean, String beanName,
ActionMapping mapping, HttpServletRequest request )
+ {
+ MessageResources messageResources = ( MessageResources )
request.getAttribute( Globals.MESSAGES_KEY );
+ ExpressionAwareMessageResources.update( messageResources, bean );
+
+ //
+ // See if this action uses a form that defines its own message
resources. If so, use those, or combine them
+ // with the message resources from the current module.
+ //
+ if ( mapping instanceof PageFlowActionMapping )
+ {
+ PageFlowActionMapping pfam = ( PageFlowActionMapping ) mapping;
+ String bundle = pfam.getFormBeanMessageResourcesKey();
+
+ if ( bundle != null )
+ {
+ MessageResources formBeanResources = ( MessageResources )
request.getAttribute( bundle );
+ ExpressionAwareMessageResources.update( formBeanResources,
bean );
+
+ if ( formBeanResources != null )
+ {
+ if ( messageResources != null )
+ {
+ formBeanResources = new MergedMessageResources(
messageResources, formBeanResources );
+ }
+
+ request.setAttribute( Globals.MESSAGES_KEY,
formBeanResources );
+ messageResources = formBeanResources;
+ }
+ }
+ }
+
+ //
+ // If there's no MessageResources for this request, create one that
can evaluate expressions.
+ //
+ if ( messageResources == null )
+ {
+ messageResources = new ExpressionAwareMessageResources( bean,
request, getServlet().getServletContext() );
+ request.setAttribute( Globals.MESSAGES_KEY, messageResources );
+ }
+
+
ServletContext servletContext = getServlet().getServletContext();
ActionErrors errors = new ActionErrors();
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=164802&r1=164801&r2=164802&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
Tue Apr 26 08:28:53 2005
@@ -361,16 +361,9 @@
das.ensureModuleRegistered( curModulePath, request );
}
- //
- // TODO: the only reason we have to do the getModuleConfig check below
is that there's an NPE bug in
- // ModuleUtils.selectModule(). I've entered
http://issues.apache.org/bugzilla/show_bug.cgi?id=32661 .
- //
- if ( InternalUtils.getModuleConfig( curModulePath, _servletContext )
!= null )
- {
- RequestUtils.selectModule( curModulePath, request, _servletContext
);
- }
+ ModuleConfig mc = InternalUtils.selectModule( curModulePath, request,
_servletContext );
- if ( RequestUtils.getRequestModuleConfig( request ) == null )
+ if ( mc == null )
{
//
// If we still haven't had success in selecting the module, see if
we can dynamically register one.
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=164802&r1=164801&r2=164802&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
Tue Apr 26 08:28:53 2005
@@ -930,10 +930,12 @@
* @param expression the expression that will be evaluated to generate the
error message.
* @param messageArgs zero or more arguments to the message.
*/
- public static void addActionErrorExpression( ServletRequest request,
String propertyName, String expression,
+ public static void addActionErrorExpression( HttpServletRequest request,
String propertyName, String expression,
Object[] messageArgs )
{
- InternalUtils.addActionError( propertyName, new ExpressionMessage(
expression, messageArgs ), request );
+ Object formBean = InternalUtils.unwrapFormBean(
InternalUtils.getCurrentActionForm( request ) );
+ ExpressionMessage msg = new ExpressionMessage( expression,
messageArgs, formBean, request );
+ InternalUtils.addActionError( propertyName, msg, request );
}
/**
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/BackingClassMethodBinding.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/BackingClassMethodBinding.java?rev=164802&r1=164801&r2=164802&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/BackingClassMethodBinding.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/faces/internal/BackingClassMethodBinding.java
Tue Apr 26 08:28:53 2005
@@ -20,6 +20,7 @@
import org.apache.beehive.netui.pageflow.internal.InternalUtils;
import org.apache.beehive.netui.pageflow.internal.AnnotationReader;
import
org.apache.beehive.netui.compiler.schema.annotations.ProcessedAnnotation;
+import org.apache.beehive.netui.util.logging.Logger;
import javax.faces.el.MethodBinding;
import javax.faces.el.MethodNotFoundException;
@@ -34,16 +35,20 @@
// TODO: rich needs to doc this when he gets all 10 of his fingers back
// TODO: move to internal
+/**
+ *
+ */
public class BackingClassMethodBinding
extends MethodBinding
implements StateHolder
{
+ private static final Logger _log = Logger.getInstance(
BackingClassMethodBinding.class );
+
private String _methodName;
private Class[] _params;
private MethodBinding _delegate;
private boolean _transient = false;
-
public BackingClassMethodBinding()
{
}
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/Interceptor.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/Interceptor.java?rev=164802&r1=164801&r2=164802&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/Interceptor.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/interceptor/Interceptor.java
Tue Apr 26 08:28:53 2005
@@ -20,8 +20,6 @@
/**
* Base class for all interceptors.
*/
-// TODO: this interface is in internal because it needs to move to a common
area.
-// TODO: the controls interceptor model
public interface Interceptor
{
public void init( InterceptorConfig config );
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultExceptionsHandler.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultExceptionsHandler.java?rev=164802&r1=164801&r2=164802&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultExceptionsHandler.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultExceptionsHandler.java
Tue Apr 26 08:28:53 2005
@@ -136,7 +136,7 @@
// This is the module that will be handling the exception.
Ensure that its message resources are
// initialized.
assert request instanceof HttpServletRequest :
request.getClass().getName();
- RequestUtils.selectModule(
flowController.getModuleConfig().getPrefix(),
+ InternalUtils.selectModule(
flowController.getModuleConfig().getPrefix(),
( HttpServletRequest ) request,
getServletContext() );
}
}
@@ -438,11 +438,7 @@
if ( bundle == null ) bundle = Globals.MESSAGES_KEY;
ServletRequest request = context.getRequest();
- MessageResources resources = ( MessageResources )
request.getAttribute( bundle );
- if ( resources == null )
- {
- resources = ( MessageResources ) getServletContext().getAttribute(
bundle );
- }
+ MessageResources resources = InternalUtils.getMessageResources(bundle,
request, getServletContext());
if ( resources == null )
{
Added:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/ExpressionAwareMessageResources.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/ExpressionAwareMessageResources.java?rev=164802&view=auto
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/ExpressionAwareMessageResources.java
(added)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/ExpressionAwareMessageResources.java
Tue Apr 26 08:28:53 2005
@@ -0,0 +1,104 @@
+/*
+ * 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.internal;
+
+import org.apache.struts.util.MessageResources;
+import org.apache.beehive.netui.util.logging.Logger;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.ServletContext;
+import java.util.HashMap;
+import java.util.Locale;
+
+/**
+ * Message resources extension that knows how to evaluate JSP 2.0-style
expressions (set in the message keys) that are
+ * prefixed with a special indicator string.
+ */
+public class ExpressionAwareMessageResources
+ extends MessageResources
+{
+ private static final Logger _log = Logger.getInstance(
ExpressionAwareMessageResources.class );
+
+ private MessageResources _delegate;
+ private Object _formBean;
+ private transient HttpServletRequest _request;
+ private transient ServletContext _servletContext;
+ private HashMap _cachedMessages = null;
+
+ public ExpressionAwareMessageResources( Object formBean,
HttpServletRequest request, ServletContext servletContext )
+ {
+ super( defaultFactory, null, true );
+ _formBean = formBean;
+ _request = request;
+ _servletContext = servletContext;
+ }
+
+ public ExpressionAwareMessageResources( MessageResources delegate, Object
formBean, HttpServletRequest request,
+ ServletContext servletContext )
+ {
+ super( delegate.getFactory(), delegate.getConfig(),
delegate.getReturnNull() );
+ _delegate = delegate;
+ _formBean = formBean;
+ _request = request;
+ _servletContext = servletContext;
+ }
+
+ public String getMessage( Locale locale, String key )
+ {
+ if ( key.startsWith( InternalConstants.MESSAGE_IS_EXPRESSION_PREFIX ) )
+ {
+ if ( _cachedMessages != null && _cachedMessages.containsKey( key )
)
+ {
+ return ( String ) _cachedMessages.get( key );
+ }
+
+ String argExpr =
key.substring(InternalConstants.MESSAGE_IS_EXPRESSION_PREFIX_LENGTH);
+ String value = null;
+
+ try
+ {
+ value = InternalExpressionUtils.evaluateMessage( argExpr,
_formBean, _request, _servletContext );
+ }
+ catch ( Exception e )
+ {
+ _log.error( "Could not evaluate message expression " +
argExpr, e );
+ }
+
+ if ( _cachedMessages == null ) _cachedMessages = new HashMap();
+ _cachedMessages.put( key, value );
+ return value;
+ }
+
+ return _delegate != null ? _delegate.getMessage( locale, key ) : null;
+ }
+
+ protected void setFormBean( Object formBean )
+ {
+ _formBean = formBean;
+ }
+
+ public static void update( MessageResources resources, Object formBean )
+ {
+ if ( resources instanceof ExpressionAwareMessageResources )
+ {
+ ( ( ExpressionAwareMessageResources ) resources ).setFormBean(
formBean );
+ }
+ }
+}
+
+
Propchange:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/ExpressionAwareMessageResources.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalExpressionUtils.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalExpressionUtils.java?rev=164802&r1=164801&r2=164802&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalExpressionUtils.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalExpressionUtils.java
Tue Apr 26 08:28:53 2005
@@ -52,10 +52,8 @@
return ((Boolean)evaluate(expression, Boolean.class, actionForm,
request, servletContext)).booleanValue();
}
- public static final String evaluateMessage(String expression,
- Object actionForm,
- HttpServletRequest request,
- ServletContext servletContext)
+ public static final String evaluateMessage(String expression, Object
actionForm, HttpServletRequest request,
+ ServletContext servletContext)
throws ELException
{
return (String)evaluate(expression, String.class, actionForm, request,
servletContext);
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java?rev=164802&r1=164801&r2=164802&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/InternalUtils.java
Tue Apr 26 08:28:53 2005
@@ -32,11 +32,13 @@
import org.apache.beehive.netui.util.config.bean.PageflowConfig;
import org.apache.beehive.netui.util.logging.Logger;
import org.apache.struts.Globals;
+import org.apache.struts.util.MessageResources;
import org.apache.struts.action.*;
import org.apache.struts.config.ActionConfig;
import org.apache.struts.config.ControllerConfig;
import org.apache.struts.config.FormBeanConfig;
import org.apache.struts.config.ModuleConfig;
+import org.apache.struts.config.MessageResourcesConfig;
import org.apache.struts.upload.MultipartRequestWrapper;
import javax.servlet.ServletContext;
@@ -545,7 +547,7 @@
public static ActionForm getFormBean( ActionMapping mapping,
ServletRequest request )
{
- String formBeanName = mapping.getName();
+ String formBeanName = mapping.getAttribute();
if ( formBeanName != null )
{
@@ -1090,5 +1092,101 @@
}
return request;
+ }
+
+ /**
+ * Set the given Struts module in the request, and expose its set of
MessageResources as request attributes.
+ *
+ * @param prefix the prefix of the desired module.
+ * @param request the current HttpServletRequest.
+ * @param servletContext the current ServletContext.
+ * @return the selected ModuleConfig, or <code>null</code> if there is
none for the given module prefix.
+ */
+ public static ModuleConfig selectModule( String prefix, HttpServletRequest
request, ServletContext servletContext )
+ {
+ ModuleConfig config = getModuleConfig( prefix, servletContext );
+
+ if ( config == null )
+ {
+ request.removeAttribute( Globals.MODULE_KEY );
+ return null;
+ }
+
+ // Just return it if it's already registered.
+ if ( request.getAttribute( Globals.MODULE_KEY ) == config ) return
config;
+
+ request.setAttribute( Globals.MODULE_KEY, config );
+
+ MessageResourcesConfig[] mrConfig =
config.findMessageResourcesConfigs();
+ Object formBean = unwrapFormBean( getCurrentActionForm( request ) );
+
+ for ( int i = 0; i < mrConfig.length; i++ )
+ {
+ String key = mrConfig[i].getKey();
+ MessageResources resources = ( MessageResources )
servletContext.getAttribute( key + prefix );
+
+ if ( resources != null )
+ {
+ if ( ! ( resources instanceof ExpressionAwareMessageResources
) )
+ {
+ resources = new ExpressionAwareMessageResources(
resources, formBean, request, servletContext );
+ }
+
+ request.setAttribute( key, resources );
+ }
+ else
+ {
+ request.removeAttribute( key );
+ }
+ }
+
+ return config;
+ }
+
+ public static MessageResources getMessageResources( String bundleName,
ServletRequest request,
+ ServletContext
servletContext )
+ {
+ MessageResources resources = (MessageResources)
request.getAttribute(bundleName);
+
+ if ( resources == null )
+ {
+ String qualified = getQualifiedBundleName(bundleName, request);
+ resources = (MessageResources)
servletContext.getAttribute(qualified);
+ }
+
+ // If we can't find resources with this name, try them at the root
(unqualified).
+ if ( resources == null ) resources = (MessageResources)
servletContext.getAttribute(bundleName);
+
+ return resources;
+ }
+
+ /**
+ * Qualify the given bundle name with the current module path to return a
full bundle name.
+ *
+ * @return the qualified Bundle name
+ */
+ public static String getQualifiedBundleName( String bundleName,
ServletRequest request )
+ {
+ if ( bundleName != null )
+ {
+ if ( bundleName.indexOf( '/' ) == -1 )
+ {
+ ModuleConfig mc = ( ModuleConfig ) request.getAttribute(
Globals.MODULE_KEY );
+
+ // Note that we don't append the module path for the root
module.
+ if ( mc != null && mc.getPrefix() != null &&
mc.getPrefix().length() > 1 )
+ {
+ bundleName += mc.getPrefix();
+ }
+ }
+ else if ( bundleName.endsWith( "/" ) )
+ {
+ // Special handling for bundles referring to the root module
-- they should not have
+ // the module path ("/") at the end.
+ bundleName = bundleName.substring( 0, bundleName.length() - 1
);
+ }
+ }
+
+ return bundleName;
}
}
Modified:
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java?rev=164802&r1=164801&r2=164802&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java
(original)
+++
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java
Tue Apr 26 08:28:53 2005
@@ -370,7 +370,7 @@
*/
public static final String getRelativeURI( HttpServletRequest request )
{
- return request.getServletPath(); // TODO: is this always decoded
under all containers?
+ return request.getServletPath();
}
/**
Modified:
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java?rev=164802&r1=164801&r2=164802&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java
(original)
+++
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java
Tue Apr 26 08:28:53 2005
@@ -133,7 +133,7 @@
try
{
- if ( encoding == null ) encoding = "utf-8"; // TODO: is this a
safe assumption?
+ if ( encoding == null ) encoding = "utf-8";
servletPath = URL_CODEC.decode( servletPath, encoding );
}
catch ( DecoderException e )
Modified:
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedResponseImpl.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedResponseImpl.java?rev=164802&r1=164801&r2=164802&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedResponseImpl.java
(original)
+++
incubator/beehive/trunk/netui/src/scoping/org/apache/beehive/netui/pageflow/scoping/internal/ScopedResponseImpl.java
Tue Apr 26 08:28:53 2005
@@ -102,12 +102,6 @@
// don't do anything
}
- public void flushBuffer() throws IOException
- {
- // don't do anything
- // @TODO should we let them flush?
- }
-
public void resetBuffer()
{
// don't do anything
@@ -116,7 +110,6 @@
public void reset()
{
// don't do anything
- // @TODO should we let them reset?
}
//
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Error.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Error.java?rev=164802&r1=164801&r2=164802&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Error.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Error.java
Tue Apr 26 08:28:53 2005
@@ -20,6 +20,7 @@
import org.apache.beehive.netui.util.internal.InternalStringBuilder;
import org.apache.beehive.netui.util.Bundle;
+import org.apache.beehive.netui.pageflow.internal.InternalUtils;
import org.apache.struts.Globals;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
@@ -119,7 +120,7 @@
return;
}
- String qualifiedBundle = getQualifiedBundleName(_bundleName);
+ String qualifiedBundle =
InternalUtils.getQualifiedBundleName(_bundleName, pageContext.getRequest());
boolean prefixPresent = false;
boolean suffixPresent = false;
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ErrorBaseTag.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ErrorBaseTag.java?rev=164802&r1=164801&r2=164802&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ErrorBaseTag.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ErrorBaseTag.java
Tue Apr 26 08:28:53 2005
@@ -22,12 +22,14 @@
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.PageFlowUtils;
import org.apache.beehive.netui.tags.AbstractSimpleTag;
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.logging.Logger;
import org.apache.struts.Globals;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
+import org.apache.struts.action.ActionForm;
import org.apache.struts.config.ControllerConfig;
import org.apache.struts.config.ModuleConfig;
import org.apache.struts.taglib.html.Constants;
@@ -104,30 +106,6 @@
_locale = setNonEmptyValueAttribute(locale);
}
- /**
- * Qualify the given bundle name with the current module path to return a
full bundle name.
- * @return the qualified Bundle name
- */
- protected String getQualifiedBundleName(String bundleName)
- {
- if (bundleName != null) {
- if (bundleName.indexOf("/") == -1) {
- ModuleConfig mc = (ModuleConfig)
getPageContext().getRequest().getAttribute(Globals.MODULE_KEY);
-
- // Note that we don't append the module path for the root
module.
- if (mc != null && mc.getPrefix() != null &&
mc.getPrefix().length() > 1) {
- bundleName += mc.getPrefix();
- }
- }
- else if (bundleName.endsWith("/")) {
- // Special handling for bundles referring to the root module
-- they should not have
- // the module path ("/") at the end.
- bundleName = bundleName.substring(0, bundleName.length() - 1);
- }
- }
-
- return bundleName;
- }
/**
* @param report
@@ -142,103 +120,41 @@
Object[] messageArgs = report.getValues();
PageContext pageContext = getPageContext();
- // First, replace expressions in all the message arguments.
- if (messageArgs != null) {
- for (int i = 0; i < messageArgs.length; ++i) {
- Object arg = messageArgs[i];
-
- if (arg instanceof String) {
- String strArg = ((String) arg);
-
- if
(strArg.startsWith(InternalConstants.MESSAGE_IS_EXPRESSION_PREFIX)) {
- String argExpr =
strArg.substring(InternalConstants.MESSAGE_IS_EXPRESSION_PREFIX_LENGTH);
- Object formBean =
pageContext.getAttribute(Constants.BEAN_KEY, PageContext.REQUEST_SCOPE);
- HttpServletRequest request = (HttpServletRequest)
pageContext.getRequest();
-
- try {
- messageArgs[i] =
InternalExpressionUtils.evaluateMessage(argExpr, formBean, request,
- pageContext.getServletContext());
- }
- catch (ELException e) {
- if (LOGGER.isErrorEnabled())
- LOGGER.error("Exception occurred evaluating
message expression '" + argExpr + "'. Cause: " + e.getCause(), e);
- }
- }
- }
- }
- }
-
- //
- // The page flow compiler generates
InternalConstants.MESSAGE_IS_EXPRESSION_KEY as the message key
- // when the message is actually an expression for us to evaluate at
runtime.
- //
String message = null;
HttpServletRequest request = (HttpServletRequest)
pageContext.getRequest();
if (key.length() == 0) {
return "";
}
- else if
(key.startsWith(InternalConstants.MESSAGE_IS_EXPRESSION_PREFIX)) {
- String expression =
key.substring(InternalConstants.MESSAGE_IS_EXPRESSION_PREFIX_LENGTH);
- Object formBean = pageContext.getAttribute(Constants.BEAN_KEY,
PageContext.REQUEST_SCOPE);
- try {
- message = InternalExpressionUtils.evaluateMessage(expression,
formBean, request, pageContext.getServletContext());
- MessageFormat format = new MessageFormat(message);
- message = format.format(messageArgs);
- }
- catch (ELException e) {
- if (LOGGER.isErrorEnabled())
- LOGGER.error("Exception occurred evaluating message
expression '" + expression + "'. Cause: " + e.getCause(), e);
- }
- }
else {
- boolean requestedSpecificBundle = (bundleName != null);
ModuleConfig curModuleConfig =
RequestUtils.getModuleConfig(pageContext);
+ ServletContext servletContext = pageContext.getServletContext();
- // First, look in the message bundle for any shared flow that was
involved in this request.
+ // First, look in the message bundle for a shared flow that was
involved in this request.
String sharedFlowModulePath =
InternalUtils.getForwardingModule(pageContext.getRequest());
- if (sharedFlowModulePath != null && (curModuleConfig == null ||
!sharedFlowModulePath.equals(curModuleConfig.getPrefix()))) {
- ServletContext servletContext =
pageContext.getServletContext();
+ if (sharedFlowModulePath != null &&
+ (curModuleConfig == null ||
!sharedFlowModulePath.equals(curModuleConfig.getPrefix()))) {
ModuleConfig sfModule =
InternalUtils.getModuleConfig(sharedFlowModulePath, servletContext);
- if (requestedSpecificBundle ||
!isMissingUserDefaultMessages(sfModule)) {
- String msgAttr = (bundleName == null ?
Globals.MESSAGES_KEY : bundleName) + sfModule.getPrefix();
- MessageResources resources = (MessageResources)
pageContext.getAttribute(msgAttr, PageContext.APPLICATION_SCOPE);
- if (resources != null) {
- Locale userLocale =
RequestUtils.retrieveUserLocale(pageContext, _locale);
- if (messageArgs == null) {
- message = resources.getMessage(userLocale, key);
- }
- else {
- message = resources.getMessage(userLocale, key,
messageArgs);
- }
- }
+ if (bundleName != null ||
!isMissingUserDefaultMessages(sfModule)) {
+ String msgAttr = (bundleName != null ? bundleName :
Globals.MESSAGES_KEY) + sfModule.getPrefix();
+ MessageResources resources = (MessageResources)
servletContext.getAttribute(msgAttr);
+ message = getMessage(resources, key, messageArgs,
pageContext);
}
}
// Next look in the default message bundle for the page flow.
boolean missingUserDefaultMessages =
isMissingUserDefaultMessages(pageContext);
- if (message == null && (requestedSpecificBundle ||
!missingUserDefaultMessages)) {
- message = RequestUtils.message(pageContext, bundleName,
_locale, key, messageArgs);
- }
-
- // If we didn't find it there, look for it in the validation
messages associated with the form bean.
- if (message == null && !requestedSpecificBundle) {
- ActionMapping actionMapping = (ActionMapping)
pageContext.getRequest().getAttribute(Globals.MAPPING_KEY);
-
- if (actionMapping instanceof PageFlowActionMapping) {
- String formBeanResources = ((PageFlowActionMapping)
actionMapping).getFormBeanMessageResourcesKey();
-
- if (formBeanResources != null) {
- String qualified =
getQualifiedBundleName(formBeanResources);
- message = RequestUtils.message(pageContext, qualified,
_locale, key, messageArgs);
- if (message != null) return message;
- }
- }
+ if (message == null && (bundleName != null ||
!missingUserDefaultMessages)) {
+ MessageResources resources =
+ InternalUtils.getMessageResources(bundleName != null ?
bundleName : Globals.MESSAGES_KEY,
+ request,
servletContext);
+ message = getMessage(resources, key, messageArgs, pageContext);
}
// If we still didn't find it, try the default validation message
bundle (in beehive-netui-pageflow.jar).
- if (message == null && !requestedSpecificBundle) {
- String qualified =
getQualifiedBundleName("_defaultValidationMessages");
- message = RequestUtils.message(pageContext, qualified,
_locale, key, messageArgs);
+ if (message == null && bundleName == null) {
+ MessageResources resources =
+
InternalUtils.getMessageResources("_defaultValidationMessages", request,
servletContext);
+ message = getMessage(resources, key, messageArgs, pageContext);
}
//
@@ -247,7 +163,7 @@
// Register a tag error for either case.
//
if (message == null) {
- if (!requestedSpecificBundle && missingUserDefaultMessages) {
+ if (bundleName == null && missingUserDefaultMessages) {
String s = Bundle.getString("Tags_ErrorsBundleMissing",
null);
registerTagError(s, null);
return null;
@@ -263,6 +179,21 @@
return message;
}
+ private String getMessage(MessageResources resources, String key, Object[]
messageArgs, PageContext pageContext)
+ {
+ if (resources != null) {
+ Locale userLocale = RequestUtils.retrieveUserLocale( pageContext,
_locale );
+ if ( messageArgs == null ) {
+ return resources.getMessage( userLocale, key );
+ }
+ else {
+ return resources.getMessage( userLocale, key, messageArgs );
+ }
+ }
+
+ return null;
+ }
+
/**
* Tell whether the given Struts module has no default message bundle
defined.
* @return <code>true</code> if the given Struts module has no
user-specified default message bundle.
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Errors.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Errors.java?rev=164802&r1=164801&r2=164802&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Errors.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Errors.java
Tue Apr 26 08:28:53 2005
@@ -20,6 +20,7 @@
import org.apache.beehive.netui.util.internal.InternalStringBuilder;
import org.apache.beehive.netui.util.Bundle;
+import org.apache.beehive.netui.pageflow.internal.InternalUtils;
import org.apache.struts.Globals;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
@@ -105,7 +106,7 @@
return;
}
- String qualifiedBundle = getQualifiedBundleName(_bundleName);
+ String qualifiedBundle =
InternalUtils.getQualifiedBundleName(_bundleName, pageContext.getRequest());
boolean headerPresent = false;
boolean footerPresent = false;
Added:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/Bean1.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/Bean1.java?rev=164802&view=auto
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/Bean1.java
(added)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/Bean1.java
Tue Apr 26 08:28:53 2005
@@ -0,0 +1,55 @@
+package validation.validateExternalBean;
+
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import java.io.Serializable;
+
+public class Bean1
+ implements Serializable
+{
+ private String _foo;
+ private String _bar;
+
+ @Jpf.ValidatableProperty(
+ [EMAIL PROTECTED](
+ chars=2,
+ messageKey="messages.foo",
+ [EMAIL PROTECTED](argKey="args.foo")}
+ )
+ )
+ public String getFoo()
+ {
+ return _foo;
+ }
+
+ public void setFoo( String foo )
+ {
+ _foo = foo;
+ }
+
+ @Jpf.ValidatableProperty(
+ [EMAIL PROTECTED](
+ chars=2,
+ message="${actionForm.message}",
+ [EMAIL PROTECTED](arg="${actionForm.arg}")}
+ )
+ )
+ public String getBar()
+ {
+ return _bar;
+ }
+
+ public void setBar( String bar )
+ {
+ _bar = bar;
+ }
+
+ public String getMessage()
+ {
+ return "message from " + getClass().getName() + ".getMessage(), with
arg: {0}";
+ }
+
+ public String getArg()
+ {
+ return "ARGH!";
+ }
+}
Propchange:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/Bean1.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/Bean2.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/Bean2.java?rev=164802&view=auto
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/Bean2.java
(added)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/Bean2.java
Tue Apr 26 08:28:53 2005
@@ -0,0 +1,30 @@
+package validation.validateExternalBean;
+
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
[EMAIL PROTECTED](
+ messageBundle="validation.validateExternalBean.BeanMessages"
+)
+public class Bean2
+ extends Bean1
+{
+ private String _baz;
+
+ @Jpf.ValidatableProperty(
+ [EMAIL PROTECTED](
+ chars=2,
+ messageKey="messages.baz",
+ [EMAIL PROTECTED](argKey="args.baz")}
+ )
+ )
+ public String getBaz()
+ {
+ return _baz;
+ }
+
+ public void setBaz( String baz )
+ {
+ _baz = baz;
+ }
+}
+
Propchange:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/Bean2.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/BeanMessages.properties
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/BeanMessages.properties?rev=164802&view=auto
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/BeanMessages.properties
(added)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/BeanMessages.properties
Tue Apr 26 08:28:53 2005
@@ -0,0 +1,2 @@
+messages.baz=This message came from BeanMessages.properties, as does arg: {0}
+args.baz=[this arg came from BeanMessages.properties]
Propchange:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/BeanMessages.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/PageFlowMessages.properties
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/PageFlowMessages.properties?rev=164802&view=auto
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/PageFlowMessages.properties
(added)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/PageFlowMessages.properties
Tue Apr 26 08:28:53 2005
@@ -0,0 +1,2 @@
+messages.foo=This message came from PageFlowMessages.properties, as does arg:
{0}
+args.foo=[this arg came from PageFlowMessages.properties]
Propchange:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/WEB-INF/src/validation/validateExternalBean/PageFlowMessages.properties
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/errors/errorsController.jpf
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/errors/errorsController.jpf?rev=164802&r1=164801&r2=164802&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/errors/errorsController.jpf
(original)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/errors/errorsController.jpf
Tue Apr 26 08:28:53 2005
@@ -15,12 +15,6 @@
*
* $Header:$
*/
-//
------------------------------------------------------------------------------
-// Generated by WebLogic Workshop
-//
-// Created on: Tue Aug 26 08:18:00 GMT-07:00 2003
-// By: rfeit
-//
-----------------------------------------------------------------------------
package tags.errors;
import org.apache.beehive.netui.pageflow.FormData;
import org.apache.beehive.netui.pageflow.Forward;
@@ -31,189 +25,6 @@
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
-/**
- * @jpf:controller
- * @jpf:message-resources resources="errors.Messages1"
- * @jpf:message-resources resources="errors.Messages2" key="anotherBundle"
- *
- * @jpf:view-properties view-properties::
- * <!-- This data is auto-generated. Hand-editing this section is not
recommended. -->
- * <view-properties>
- * <pageflow-object id="pageflow:/tags/errors/errorsController.jpf"/>
- * <pageflow-object id="action:begin.do">
- * <property value="60" name="x"/>
- * <property value="100" name="y"/>
- * </pageflow-object>
- * <pageflow-object
id="action:errorAction.do#tags.errors.errorsController.SomeActionForm">
- * <property value="660" name="x"/>
- * <property value="100" name="y"/>
- * </pageflow-object>
- * <pageflow-object
id="action:errorsAction1.do#tags.errors.errorsController.SomeActionForm">
- * <property value="120" name="x"/>
- * <property value="200" name="y"/>
- * </pageflow-object>
- * <pageflow-object
id="action:errorsAction4.do#tags.errors.errorsController.SomeActionForm">
- * <property value="480" name="x"/>
- * <property value="200" name="y"/>
- * </pageflow-object>
- * <pageflow-object id="action:goPrev.do">
- * <property value="300" name="x"/>
- * <property value="480" name="y"/>
- * </pageflow-object>
- * <pageflow-object id="action-call:@page:[EMAIL PROTECTED]@action:goPrev.do@">
- * <property value="120,120,192,264" name="elbowsX"/>
- * <property value="384,472,472,472" name="elbowsY"/>
- * <property value="South_1" name="fromPort"/>
- * <property value="West_1" name="toPort"/>
- * </pageflow-object>
- * <pageflow-object id="page:errors1.jsp">
- * <property value="120" name="x"/>
- * <property value="340" name="y"/>
- * </pageflow-object>
- * <pageflow-object id="action-call:@page:[EMAIL PROTECTED]@action:goPrev.do@">
- * <property value="240,240,289,289" name="elbowsX"/>
- * <property value="384,410,410,436" name="elbowsY"/>
- * <property value="South_1" name="fromPort"/>
- * <property value="North_0" name="toPort"/>
- * </pageflow-object>
- * <pageflow-object id="page:errors2.jsp">
- * <property value="240" name="x"/>
- * <property value="340" name="y"/>
- * </pageflow-object>
- * <pageflow-object id="action-call:@page:[EMAIL PROTECTED]@action:goPrev.do@">
- * <property value="360,360,311,311" name="elbowsX"/>
- * <property value="384,410,410,436" name="elbowsY"/>
- * <property value="South_1" name="fromPort"/>
- * <property value="North_2" name="toPort"/>
- * </pageflow-object>
- * <pageflow-object id="page:errors3.jsp">
- * <property value="360" name="x"/>
- * <property value="340" name="y"/>
- * </pageflow-object>
- * <pageflow-object id="action-call:@page:[EMAIL PROTECTED]@action:goPrev.do@">
- * <property value="480,480,408,336" name="elbowsX"/>
- * <property value="384,472,472,472" name="elbowsY"/>
- * <property value="South_1" name="fromPort"/>
- * <property value="East_1" name="toPort"/>
- * </pageflow-object>
- * <pageflow-object id="page:errors4.jsp">
- * <property value="480" name="x"/>
- * <property value="340" name="y"/>
- * </pageflow-object>
- * <pageflow-object
id="action:errorsAction2.do#tags.errors.errorsController.SomeActionForm">
- * <property value="240" name="x"/>
- * <property value="200" name="y"/>
- * </pageflow-object>
- * <pageflow-object
id="action:errorsAction3.do#tags.errors.errorsController.SomeActionForm">
- * <property value="360" name="x"/>
- * <property value="200" name="y"/>
- * </pageflow-object>
- * <pageflow-object id="action-call:@page:[EMAIL
PROTECTED]@action:errorsAction1.do#tags.errors.errorsController.SomeActionForm@">
- * <property value="264,210,210,156" name="elbowsX"/>
- * <property value="103,103,192,192" name="elbowsY"/>
- * <property value="West_2" name="fromPort"/>
- * <property value="East_1" name="toPort"/>
- * </pageflow-object>
- * <pageflow-object id="action-call:@page:[EMAIL
PROTECTED]@action:errorsAction2.do#tags.errors.errorsController.SomeActionForm@">
- * <property value="289,289,282,276" name="elbowsX"/>
- * <property value="144,192,192,192" name="elbowsY"/>
- * <property value="South_0" name="fromPort"/>
- * <property value="East_1" name="toPort"/>
- * </pageflow-object>
- * <pageflow-object id="action-call:@page:[EMAIL
PROTECTED]@action:errorsAction4.do#tags.errors.errorsController.SomeActionForm@">
- * <property value="336,390,390,444" name="elbowsX"/>
- * <property value="103,103,192,192" name="elbowsY"/>
- * <property value="East_2" name="fromPort"/>
- * <property value="West_1" name="toPort"/>
- * </pageflow-object>
- * <pageflow-object id="action-call:@page:[EMAIL
PROTECTED]@action:errorsAction3.do#tags.errors.errorsController.SomeActionForm@">
- * <property value="311,311,317,324" name="elbowsX"/>
- * <property value="144,192,192,192" name="elbowsY"/>
- * <property value="South_2" name="fromPort"/>
- * <property value="West_1" name="toPort"/>
- * </pageflow-object>
- * <pageflow-object id="action-call:@page:[EMAIL
PROTECTED]@action:errorAction.do#tags.errors.errorsController.SomeActionForm@">
- * <property value="336,480,480,624" name="elbowsX"/>
- * <property value="92,92,92,92" name="elbowsY"/>
- * <property value="East_1" name="fromPort"/>
- * <property value="West_1" name="toPort"/>
- * </pageflow-object>
- * <pageflow-object id="page:index.jsp">
- * <property value="300" name="x"/>
- * <property value="100" name="y"/>
- * </pageflow-object>
- * <pageflow-object id="forward:[EMAIL PROTECTED]:begin.do@">
- * <property value="96,180,180,264" name="elbowsX"/>
- * <property value="92,92,92,92" name="elbowsY"/>
- * <property value="East_1" name="fromPort"/>
- * <property value="West_1" name="toPort"/>
- * <property value="success" name="label"/>
- * </pageflow-object>
- * <pageflow-object id="return-to:@forward:[EMAIL
PROTECTED]:errorAction.do#tags.errors.errorsController.SomeActionForm@@">
- * <property value="800" name="x"/>
- * <property value="100" name="y"/>
- * </pageflow-object>
- * <pageflow-object id="forward:[EMAIL
PROTECTED]:errorAction.do#tags.errors.errorsController.SomeActionForm@">
- * <property value="696,730,730,764" name="elbowsX"/>
- * <property value="92,92,92,92" name="elbowsY"/>
- * <property value="East_1" name="fromPort"/>
- * <property value="West_1" name="toPort"/>
- * <property value="success" name="label"/>
- * </pageflow-object>
- * <pageflow-object id="return-to:@forward:[EMAIL
PROTECTED]:errorAction.do#tags.errors.errorsController.SomeActionForm@@">
- * <property value="660" name="x"/>
- * <property value="240" name="y"/>
- * </pageflow-object>
- * <pageflow-object id="forward:[EMAIL
PROTECTED]:errorAction.do#tags.errors.errorsController.SomeActionForm@">
- * <property value="660,660,660,660" name="elbowsX"/>
- * <property value="144,170,170,196" name="elbowsY"/>
- * <property value="South_1" name="fromPort"/>
- * <property value="North_1" name="toPort"/>
- * <property value="current" name="label"/>
- * </pageflow-object>
- * <pageflow-object id="forward:[EMAIL
PROTECTED]:errorsAction1.do#tags.errors.errorsController.SomeActionForm@">
- * <property value="120,120,120,120" name="elbowsX"/>
- * <property value="244,270,270,296" name="elbowsY"/>
- * <property value="South_1" name="fromPort"/>
- * <property value="North_1" name="toPort"/>
- * <property value="success" name="label"/>
- * </pageflow-object>
- * <pageflow-object id="forward:[EMAIL
PROTECTED]:errorsAction4.do#tags.errors.errorsController.SomeActionForm@">
- * <property value="480,480,480,480" name="elbowsX"/>
- * <property value="244,270,270,296" name="elbowsY"/>
- * <property value="South_1" name="fromPort"/>
- * <property value="North_1" name="toPort"/>
- * <property value="success" name="label"/>
- * </pageflow-object>
- * <pageflow-object id="return-to:@forward:[EMAIL PROTECTED]:goPrev.do@@">
- * <property value="300" name="x"/>
- * <property value="600" name="y"/>
- * </pageflow-object>
- * <pageflow-object id="forward:[EMAIL PROTECTED]:goPrev.do@">
- * <property value="300,300,300,300" name="elbowsX"/>
- * <property value="524,540,540,556" name="elbowsY"/>
- * <property value="South_1" name="fromPort"/>
- * <property value="North_1" name="toPort"/>
- * <property value="prev" name="label"/>
- * </pageflow-object>
- * <pageflow-object id="formbean:tags.errors.errorsController.SomeActionForm"/>
- * <pageflow-object id="forward:[EMAIL
PROTECTED]:errorsAction2.do#tags.errors.errorsController.SomeActionForm@">
- * <property value="240,240,240,240" name="elbowsX"/>
- * <property value="244,270,270,296" name="elbowsY"/>
- * <property value="South_1" name="fromPort"/>
- * <property value="North_1" name="toPort"/>
- * <property value="success" name="label"/>
- * </pageflow-object>
- * <pageflow-object id="forward:[EMAIL
PROTECTED]:errorsAction3.do#tags.errors.errorsController.SomeActionForm@">
- * <property value="360,360,360,360" name="elbowsX"/>
- * <property value="244,270,270,296" name="elbowsY"/>
- * <property value="South_1" name="fromPort"/>
- * <property value="North_1" name="toPort"/>
- * <property value="success" name="label"/>
- * </pageflow-object>
- * </view-properties>
- * ::
- */
@Jpf.Controller(
messageBundles = {
@Jpf.MessageBundle(
@@ -221,185 +32,8 @@
@Jpf.MessageBundle(
bundlePath = "errors.Messages2",
bundleName = "anotherBundle")
- })
[EMAIL PROTECTED](
- value = {
- "<!-- This data is auto-generated. Hand-editing this section is not
recommended. -->",
- "<view-properties>",
- "<pageflow-object id='pageflow:/tags/errors/errorsController.jpf'/>",
- "<pageflow-object id='action:begin.do'>",
- " <property value='60' name='x'/>",
- " <property value='100' name='y'/>",
- "</pageflow-object>",
- "<pageflow-object
id='action:errorAction.do#tags.errors.errorsController.SomeActionForm'>",
- " <property value='660' name='x'/>",
- " <property value='100' name='y'/>",
- "</pageflow-object>",
- "<pageflow-object
id='action:errorsAction1.do#tags.errors.errorsController.SomeActionForm'>",
- " <property value='120' name='x'/>",
- " <property value='200' name='y'/>",
- "</pageflow-object>",
- "<pageflow-object
id='action:errorsAction4.do#tags.errors.errorsController.SomeActionForm'>",
- " <property value='480' name='x'/>",
- " <property value='200' name='y'/>",
- "</pageflow-object>",
- "<pageflow-object id='action:goPrev.do'>",
- " <property value='300' name='x'/>",
- " <property value='480' name='y'/>",
- "</pageflow-object>",
- "<pageflow-object id='action-call:@page:[EMAIL
PROTECTED]@action:goPrev.do@'>",
- " <property value='120,120,192,264' name='elbowsX'/>",
- " <property value='384,472,472,472' name='elbowsY'/>",
- " <property value='South_1' name='fromPort'/>",
- " <property value='West_1' name='toPort'/>",
- "</pageflow-object>",
- "<pageflow-object id='page:errors1.jsp'>",
- " <property value='120' name='x'/>",
- " <property value='340' name='y'/>",
- "</pageflow-object>",
- "<pageflow-object id='action-call:@page:[EMAIL
PROTECTED]@action:goPrev.do@'>",
- " <property value='240,240,289,289' name='elbowsX'/>",
- " <property value='384,410,410,436' name='elbowsY'/>",
- " <property value='South_1' name='fromPort'/>",
- " <property value='North_0' name='toPort'/>",
- "</pageflow-object>",
- "<pageflow-object id='page:errors2.jsp'>",
- " <property value='240' name='x'/>",
- " <property value='340' name='y'/>",
- "</pageflow-object>",
- "<pageflow-object id='action-call:@page:[EMAIL
PROTECTED]@action:goPrev.do@'>",
- " <property value='360,360,311,311' name='elbowsX'/>",
- " <property value='384,410,410,436' name='elbowsY'/>",
- " <property value='South_1' name='fromPort'/>",
- " <property value='North_2' name='toPort'/>",
- "</pageflow-object>",
- "<pageflow-object id='page:errors3.jsp'>",
- " <property value='360' name='x'/>",
- " <property value='340' name='y'/>",
- "</pageflow-object>",
- "<pageflow-object id='action-call:@page:[EMAIL
PROTECTED]@action:goPrev.do@'>",
- " <property value='480,480,408,336' name='elbowsX'/>",
- " <property value='384,472,472,472' name='elbowsY'/>",
- " <property value='South_1' name='fromPort'/>",
- " <property value='East_1' name='toPort'/>",
- "</pageflow-object>",
- "<pageflow-object id='page:errors4.jsp'>",
- " <property value='480' name='x'/>",
- " <property value='340' name='y'/>",
- "</pageflow-object>",
- "<pageflow-object
id='action:errorsAction2.do#tags.errors.errorsController.SomeActionForm'>",
- " <property value='240' name='x'/>",
- " <property value='200' name='y'/>",
- "</pageflow-object>",
- "<pageflow-object
id='action:errorsAction3.do#tags.errors.errorsController.SomeActionForm'>",
- " <property value='360' name='x'/>",
- " <property value='200' name='y'/>",
- "</pageflow-object>",
- "<pageflow-object id='action-call:@page:[EMAIL
PROTECTED]@action:errorsAction1.do#tags.errors.errorsController.SomeActionForm@'>",
- " <property value='264,210,210,156' name='elbowsX'/>",
- " <property value='103,103,192,192' name='elbowsY'/>",
- " <property value='West_2' name='fromPort'/>",
- " <property value='East_1' name='toPort'/>",
- "</pageflow-object>",
- "<pageflow-object id='action-call:@page:[EMAIL
PROTECTED]@action:errorsAction2.do#tags.errors.errorsController.SomeActionForm@'>",
- " <property value='289,289,282,276' name='elbowsX'/>",
- " <property value='144,192,192,192' name='elbowsY'/>",
- " <property value='South_0' name='fromPort'/>",
- " <property value='East_1' name='toPort'/>",
- "</pageflow-object>",
- "<pageflow-object id='action-call:@page:[EMAIL
PROTECTED]@action:errorsAction4.do#tags.errors.errorsController.SomeActionForm@'>",
- " <property value='336,390,390,444' name='elbowsX'/>",
- " <property value='103,103,192,192' name='elbowsY'/>",
- " <property value='East_2' name='fromPort'/>",
- " <property value='West_1' name='toPort'/>",
- "</pageflow-object>",
- "<pageflow-object id='action-call:@page:[EMAIL
PROTECTED]@action:errorsAction3.do#tags.errors.errorsController.SomeActionForm@'>",
- " <property value='311,311,317,324' name='elbowsX'/>",
- " <property value='144,192,192,192' name='elbowsY'/>",
- " <property value='South_2' name='fromPort'/>",
- " <property value='West_1' name='toPort'/>",
- "</pageflow-object>",
- "<pageflow-object id='action-call:@page:[EMAIL
PROTECTED]@action:errorAction.do#tags.errors.errorsController.SomeActionForm@'>",
- " <property value='336,480,480,624' name='elbowsX'/>",
- " <property value='92,92,92,92' name='elbowsY'/>",
- " <property value='East_1' name='fromPort'/>",
- " <property value='West_1' name='toPort'/>",
- "</pageflow-object>",
- "<pageflow-object id='page:index.jsp'>",
- " <property value='300' name='x'/>",
- " <property value='100' name='y'/>",
- "</pageflow-object>",
- "<pageflow-object id='forward:[EMAIL PROTECTED]:begin.do@'>",
- " <property value='96,180,180,264' name='elbowsX'/>",
- " <property value='92,92,92,92' name='elbowsY'/>",
- " <property value='East_1' name='fromPort'/>",
- " <property value='West_1' name='toPort'/>",
- " <property value='success' name='label'/>",
- "</pageflow-object>",
- "<pageflow-object id='return-to:@forward:[EMAIL
PROTECTED]:errorAction.do#tags.errors.errorsController.SomeActionForm@@'>",
- " <property value='800' name='x'/>",
- " <property value='100' name='y'/>",
- "</pageflow-object>",
- "<pageflow-object id='forward:[EMAIL
PROTECTED]:errorAction.do#tags.errors.errorsController.SomeActionForm@'>",
- " <property value='696,730,730,764' name='elbowsX'/>",
- " <property value='92,92,92,92' name='elbowsY'/>",
- " <property value='East_1' name='fromPort'/>",
- " <property value='West_1' name='toPort'/>",
- " <property value='success' name='label'/>",
- "</pageflow-object>",
- "<pageflow-object id='return-to:@forward:[EMAIL
PROTECTED]:errorAction.do#tags.errors.errorsController.SomeActionForm@@'>",
- " <property value='660' name='x'/>",
- " <property value='240' name='y'/>",
- "</pageflow-object>",
- "<pageflow-object id='forward:[EMAIL
PROTECTED]:errorAction.do#tags.errors.errorsController.SomeActionForm@'>",
- " <property value='660,660,660,660' name='elbowsX'/>",
- " <property value='144,170,170,196' name='elbowsY'/>",
- " <property value='South_1' name='fromPort'/>",
- " <property value='North_1' name='toPort'/>",
- " <property value='current' name='label'/>",
- "</pageflow-object>",
- "<pageflow-object id='forward:[EMAIL
PROTECTED]:errorsAction1.do#tags.errors.errorsController.SomeActionForm@'>",
- " <property value='120,120,120,120' name='elbowsX'/>",
- " <property value='244,270,270,296' name='elbowsY'/>",
- " <property value='South_1' name='fromPort'/>",
- " <property value='North_1' name='toPort'/>",
- " <property value='success' name='label'/>",
- "</pageflow-object>",
- "<pageflow-object id='forward:[EMAIL
PROTECTED]:errorsAction4.do#tags.errors.errorsController.SomeActionForm@'>",
- " <property value='480,480,480,480' name='elbowsX'/>",
- " <property value='244,270,270,296' name='elbowsY'/>",
- " <property value='South_1' name='fromPort'/>",
- " <property value='North_1' name='toPort'/>",
- " <property value='success' name='label'/>",
- "</pageflow-object>",
- "<pageflow-object id='return-to:@forward:[EMAIL
PROTECTED]:goPrev.do@@'>",
- " <property value='300' name='x'/>",
- " <property value='600' name='y'/>",
- "</pageflow-object>",
- "<pageflow-object id='forward:[EMAIL PROTECTED]:goPrev.do@'>",
- " <property value='300,300,300,300' name='elbowsX'/>",
- " <property value='524,540,540,556' name='elbowsY'/>",
- " <property value='South_1' name='fromPort'/>",
- " <property value='North_1' name='toPort'/>",
- " <property value='prev' name='label'/>",
- "</pageflow-object>",
- "<pageflow-object
id='formbean:tags.errors.errorsController.SomeActionForm'/>",
- "<pageflow-object id='forward:[EMAIL
PROTECTED]:errorsAction2.do#tags.errors.errorsController.SomeActionForm@'>",
- " <property value='240,240,240,240' name='elbowsX'/>",
- " <property value='244,270,270,296' name='elbowsY'/>",
- " <property value='South_1' name='fromPort'/>",
- " <property value='North_1' name='toPort'/>",
- " <property value='success' name='label'/>",
- "</pageflow-object>",
- "<pageflow-object id='forward:[EMAIL
PROTECTED]:errorsAction3.do#tags.errors.errorsController.SomeActionForm@'>",
- " <property value='360,360,360,360' name='elbowsX'/>",
- " <property value='244,270,270,296' name='elbowsY'/>",
- " <property value='South_1' name='fromPort'/>",
- " <property value='North_1' name='toPort'/>",
- " <property value='success' name='label'/>",
- "</pageflow-object>",
- "</view-properties>"
- })
+ }
+)
public class errorsController extends PageFlowController
{
/**