[CONF] Confluence Changes in the last 24 hours
- This is a daily summary of all recent changes in Confluence. - Updated Spaces: - OpenJPA (openjpa) http://cwiki.apache.org/confluence/display/openjpa | |-Pages Added or Edited in This Space |-- Recovering from a vetoed release was created by [EMAIL PROTECTED] (04:48 PM). | http://cwiki.apache.org/confluence/display/openjpa/Recovering+from+a+vetoed+release |-- New Release Instructions (BETA) was last edited by [EMAIL PROTECTED] (04:11 PM). | http://cwiki.apache.org/confluence/display/openjpa/New+Release+Instructions+%28BETA%29 Apache Camel (CAMEL) http://cwiki.apache.org/confluence/display/CAMEL | |-Pages Added or Edited in This Space |-- Tutorial-Example-ReportIncident was created by davsclaus (05:41 AM). | http://cwiki.apache.org/confluence/display/CAMEL/Tutorial-Example-ReportIncident |-- Hibernate was last edited by jstrachan (07:27 AM). | http://cwiki.apache.org/confluence/display/CAMEL/Hibernate |-- Recipient List was last edited by jstrachan (05:23 AM). | http://cwiki.apache.org/confluence/display/CAMEL/Recipient+List |-- Log was last edited by davsclaus (02:21 AM). | http://cwiki.apache.org/confluence/display/CAMEL/Log |-- Camel 1.4.0 Release was last edited by davsclaus (12:16 AM). | http://cwiki.apache.org/confluence/display/CAMEL/Camel+1.4.0+Release |-- Flatpack was last edited by davsclaus (12:11 AM). | http://cwiki.apache.org/confluence/display/CAMEL/Flatpack Apache Directory Server v1.5 (DIRxSRVx11) http://cwiki.apache.org/confluence/display/DIRxSRVx11 | |-Pages Added or Edited in This Space |-- DN Parsing was last edited by elecharny (03:04 PM). | http://cwiki.apache.org/confluence/display/DIRxSRVx11/DN+Parsing Apache Sling Website (SLINGxSITE) http://cwiki.apache.org/confluence/display/SLINGxSITE | |-Pages Added or Edited in This Space |-- Content Loading was last edited by [EMAIL PROTECTED] (09:17 AM). | http://cwiki.apache.org/confluence/display/SLINGxSITE/Content+Loading |-- Object Content Mapping was created by [EMAIL PROTECTED] (09:07 AM). | http://cwiki.apache.org/confluence/display/SLINGxSITE/Object+Content+Mapping |-- Advanced Topics was last edited by [EMAIL PROTECTED] (09:07 AM). | http://cwiki.apache.org/confluence/display/SLINGxSITE/Advanced+Topics |-- Apache Sling was last edited by [EMAIL PROTECTED] (09:02 AM). | http://cwiki.apache.org/confluence/display/SLINGxSITE/Apache+Sling Apache Struts 2 Plugin Registry (S2PLUGINS) http://cwiki.apache.org/confluence/display/S2PLUGINS | |-Pages Added or Edited in This Space |-- Convention Plugin was last edited by musachy (08:24 AM). | http://cwiki.apache.org/confluence/display/S2PLUGINS/Convention+Plugin Apache Geronimo Project Management (GMOxPMGT) http://cwiki.apache.org/confluence/display/GMOxPMGT | |-Pages Added or Edited in This Space |-- Geronimo 2.1.2 Release Plan was last edited by gawor (11:41 AM). | http://cwiki.apache.org/confluence/display/GMOxPMGT/Geronimo+2.1.2+Release+Plan Apache Struts 2 Documentation (WW) http://cwiki.apache.org/confluence/display/WW | |-New Comments in This Space |-- http://cwiki.apache.org/confluence/display/WW/subset (1) |-- http://cwiki.apache.org/confluence/display/WW/generator (1) |-- http://cwiki.apache.org/confluence/display/WW/DWR+Plugin (1) Apache Geronimo v2.1 (GMOxDOC21) http://cwiki.apache.org/confluence/display/GMOxDOC21 | |-Pages Added or Edited in This Space |-- Sample applications was last edited by jbohn (08:37 AM). | http://cwiki.apache.org/confluence/display/GMOxDOC21/Sample+applications Apache Tuscany (TUSCANY) http://cwiki.apache.org/confluence/display/TUSCANY | |-Pages Added or Edited in This Space |-- SCA Java binding.jms was last edited by ant (07:51 AM). | http://cwiki.apache.org/confluence/display/TUSCANY/SCA+Java+binding.jms Apache Wicket (WICKET) http://cwiki.apache.org/confluence/display/WICKET | |-Pages Added or Edited in This Space |-- Wicket Amsterdam 2007-11-30 was last edited by [EMAIL PROTECTED] (11:50 AM). | http://cwiki.apache.org/confluence/display/WICKET/Wicket+Amsterdam+2007-11-30 |-- URL Coding Strategies was last edited by gwynevans (04:41 AM). | http://cwiki.apache.org/confluence/display/WICKET/URL+Coding+Strategies |-- Obfuscating urls was last edited by gwynevans (04:38 AM). | http://cwiki.apache.org/confluence/display/WICKET/Obfuscating+urls Apache Qpid (qpid) http://cwiki.apache.org/confluence/display/qpid | |-Pages Added or Edited in This Space |-- ClusteringHA was last edited by aconway (07:57 AM). | http://cwiki.apache.org/confluence/display/qpid/ClusteringHA | |-New Comments in This Space |-- http://cwiki.apache.org/confluence/display/qpid/Producer+flow+control (1) Apache ActiveMQ (ACTIVEMQ) http://cwiki.apache.org/confluence/display/
svn commit: r677429 - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptor.java
Author: musachy Date: Wed Jul 16 14:01:56 2008 New Revision: 677429 URL: http://svn.apache.org/viewvc?rev=677429&view=rev Log: WW-2721 Ajax Validation does not work with ModelDriven Actions Thanks to Wolfgang Schröder for the patch Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptor.java Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptor.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptor.java?rev=677429&r1=677428&r2=677429&view=diff == --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptor.java (original) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptor.java Wed Jul 16 14:01:56 2008 @@ -34,6 +34,7 @@ import com.opensymphony.xwork2.Action; import com.opensymphony.xwork2.ActionInvocation; +import com.opensymphony.xwork2.ModelDriven; import com.opensymphony.xwork2.ValidationAware; import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor; import com.opensymphony.xwork2.util.logging.Logger; @@ -43,7 +44,7 @@ * Serializes validation and action errors into JSON. This interceptor does not * perform any validation, so it must follow the 'validation' interceptor on the stack. * - * + * * This stack (defined in struts-default.xml) shows how to use this interceptor with the * 'validation' interceptor * @@ -58,19 +59,19 @@ * * If 'validationFailedStatus' is set it will be used as the Response status * when validation fails. - * - * If the request has a parameter 'struts.validateOnly' execution will return after + * + * If the request has a parameter 'struts.validateOnly' execution will return after * validation (action won't be executed). - * + * * A request parameter named 'enableJSONValidation' must be set to 'true' to * use this interceptor */ public class JSONValidationInterceptor extends MethodFilterInterceptor { private static final Logger LOG = LoggerFactory.getLogger(JSONValidationInterceptor.class); - + private static final String VALIDATE_ONLY_PARAM = "struts.validateOnly"; private static final String VALIDATE_JSON_PARAM = "struts.enableJSONValidation"; - + static char[] hex = "0123456789ABCDEF".toCharArray(); private int validationFailedStatus = -1; @@ -90,7 +91,7 @@ Object action = invocation.getAction(); String jsonEnabled = request.getParameter(VALIDATE_JSON_PARAM); - + if (jsonEnabled != null && "true".equals(jsonEnabled)) { if (action instanceof ValidationAware) { // generate json @@ -130,7 +131,7 @@ //action errors if (validationAware.hasActionErrors()) { sb.append("\"errors\":"); -sb.append(buildArray(validationAware.getActionErrors())); +sb.append(buildArray(validationAware.getActionErrors())); } //field errors @@ -143,7 +144,9 @@ for (Map.Entry> fieldError : fieldErrors .entrySet()) { sb.append("\""); -sb.append(fieldError.getKey()); +//if it is model driven, remove "model." see WW-2721 +sb.append(validationAware instanceof ModelDriven ? fieldError.getKey().substring(6) +: fieldError.getKey()); sb.append("\":"); sb.append(buildArray(fieldError.getValue())); sb.append(",");