Index: stripes/src/net/sourceforge/stripes/controller/DefaultActionBeanPropertyBinder.java =================================================================== --- stripes/src/net/sourceforge/stripes/controller/DefaultActionBeanPropertyBinder.java (revision 1413) +++ stripes/src/net/sourceforge/stripes/controller/DefaultActionBeanPropertyBinder.java (revision ) @@ -58,13 +58,13 @@ * expression support to perform JavaBean property binding. Several additions/enhancements are * available above and beyond the standard JavaBean syntax. These include: *
- * + * ** Individual property binding is delegated to the other interface method, bind(ActionBean, * String, Object), in order to allow for easy extension of this class. *
- * + * * @param bean the ActionBean whose properties are to be validated and bound * @param context the ActionBeanContext of the current request * @param validate true indicates that validation should be run, false indicates that only type @@ -241,12 +241,12 @@ * expression is available through the {@code getExpression()} and the ActionBean is available * through the {@code getBean()} method on the evaluation. * - * + * ** By default checks to ensure that the expression is not attempting to bind into the * ActionBeanContext for security reasons. *
- * + * * @param eval the expression evaluation to check for binding permission * @return true if binding can/should proceed, false to veto binding */ @@ -255,6 +255,8 @@ .isBindingAllowed(eval); if (!allowed) { String param = eval.getExpression().getSource(); + if(configuration.isDebugMode()) + throw new BindingDeniedException(param); log.warn("Binding denied for parameter [", param, "]"); } return allowed; @@ -264,7 +266,7 @@ * Invoked whenever an exception is thrown when attempting to bind a property to an ActionBean. * By default logs some information about the occurrence, but could be overridden to do more * intelligent things based on the application. - * + * * @param bean the ActionBean that was the subject of binding * @param name the ParameterName object for the parameter being bound * @param values the list of values being bound, potentially null if the error occurred when @@ -290,7 +292,7 @@ * Uses a hidden field to determine what (if any) fields were present in the form but did not get * submitted to the server. For each such field the value is "softly" set to null on the * ActionBean. This is not uncommon for checkboxes, and also for multi-selects. - * + * * @param bean the ActionBean being bound to * @param context the current ActionBeanContext */ @@ -316,7 +318,7 @@ * hidden field containing a set of field names. This is encrypted to stop the user from * monkeying with it. This method retrieves the list of field names, decrypts it and splits it * out into a Collection of field names. - * + * * @param bean the current ActionBean * @return a non-null (though possibly empty) list of field names */ @@ -349,7 +351,7 @@ * Internal helper method to bind one or more values to a single property on an ActionBean. If * the target type is an array of Collection, then all values are bound. If the target type is a * scalar type then the first value in the List of values is bound. - * + * * @param bean the ActionBean instance to which the property is being bound * @param propertyEvaluation the property evaluation to be used to set the property * @param valueOrValues a List containing one or more values @@ -389,7 +391,7 @@ * or intervening objects in a nested property are null, nothing is done. If the property is * non-null, it will be set to null. Unless the property is a collection, in which case it will * be clear()'d. - * + * * @param bean the ActionBean to which properties are being bound * @param property the name of the property being bound * @param type the declared type of the property on the ActionBean @@ -424,7 +426,7 @@ /** * Attempt to set the named property on the target bean. If the binding fails for any reason * (property does not exist, type conversion not possible etc.) an exception will be thrown. - * + * * @param bean the ActionBean on to which the property is to be bound * @param propertyName the name of the property to be bound (simple or complex) * @param propertyValue the value of the target property @@ -534,13 +536,13 @@ * having one or more values, and where each value is a non-empty String after it has had white * space trimmed from each end. *- * + * *
* For any fields that fail validation, creates a ScopedLocaliableError that uses the stripped * name of the field to find localized info (e.g. foo.bar instead of foo[1].bar). The error is * bound to the actual field on the form though, e.g. foo[1].bar. *
- * + * * @param name the name of the parameter verbatim from the request * @param strippedName the name of the parameter with any indexing removed from it * @param values the String[] of values that was submitted in the request @@ -580,7 +582,7 @@ /** * Performs several basic validations on the String value supplied in the HttpServletRequest, * based on information provided in annotations on the ActionBean. - * + * * @param propertyName the name of the property being validated (used for constructing errors) * @param values the String[] of values from the request being validated * @param validationInfo the ValidationMetadata for the property being validated @@ -626,7 +628,7 @@ * Performs basic post-conversion validations on the properties of the ActionBean after they * have been converted to their rich type by the type conversion system. Validates single * properties in isolation from other properties. - * + * * @param bean the ActionBean that is undergoing validation and binding * @param convertedValues a map of ParameterName to all converted values for each field * @param errors the validation errors object to put errors in to @@ -681,7 +683,7 @@ * {@literal @}Validate annotation. The expression is evaluated once for each value converted. * See {@link net.sourceforge.stripes.validation.expression.ExpressionValidator} for details * on how this is implemented. - * + * * @param bean the ActionBean who's property is being validated * @param name the name of the property being validated * @param values the non-null post-conversion values for the property @@ -705,14 +707,14 @@ * no default converter, then a Constructor will be looked for on the target type which takes a * single String parameter. If such a Constructor exists it will be invoked. * - * + * ** Only parameter values that are non-null and do not equal the empty String will be converted * and returned. So an input array with one entry equaling the empty string, [""], will result * in an empty List being returned. Similarly, if a length three array is passed in with * one item equaling the empty String, a List of length two will be returned. *
- * + * * @param bean the ActionBean on which the property to convert exists * @param propertyName the name of the property being converted * @param values a String array of values to attempt conversion of @@ -838,7 +840,7 @@ /** * An inner class that represents a "row" of form properties that all have the same index - * so that we can validate all those properties together. + * so that we can validate all those properties together. */ protected static class Row extends HashMap