[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 |-- OpenJPA Up Close and Personal was last edited by craigrussell (12:18 PM). | http://cwiki.apache.org/confluence/display/openjpa/OpenJPA+Up+Close+and+Personal Apache Camel (CAMEL) http://cwiki.apache.org/confluence/display/CAMEL | |-Pages Added or Edited in This Space |-- File was last edited by jstrachan (11:51 AM). | http://cwiki.apache.org/confluence/display/CAMEL/File |-- BAM was created by jstrachan (02:29 AM). | http://cwiki.apache.org/confluence/display/CAMEL/BAM |-- Correlation Identifier was created by jstrachan (02:40 AM). | http://cwiki.apache.org/confluence/display/CAMEL/Correlation+Identifier |-- Enterprise Integration Patterns was last edited by jstrachan (02:31 AM). | http://cwiki.apache.org/confluence/display/CAMEL/Enterprise+Integration+Patterns |-- Mock was last edited by jstrachan (01:46 AM). | http://cwiki.apache.org/confluence/display/CAMEL/Mock Apache CXF 2.0 Documentation (CXF20DOC) http://cwiki.apache.org/confluence/display/CXF20DOC | |-Pages Added or Edited in This Space |-- CXF Architecture was last edited by jeff.yu (08:37 PM). | http://cwiki.apache.org/confluence/display/CXF20DOC/CXF+Architecture |-- Configuration was last edited by andreasmyth (03:19 AM). | http://cwiki.apache.org/confluence/display/CXF20DOC/Configuration |-- DeploymentSpring was created by andreasmyth (03:18 AM). | http://cwiki.apache.org/confluence/display/CXF20DOC/DeploymentSpring |-- Index was last edited by andreasmyth (03:15 AM). | http://cwiki.apache.org/confluence/display/CXF20DOC/Index Apache ActiveMQ CPP (AMQCPP) http://cwiki.apache.org/confluence/display/AMQCPP | |-Pages Added or Edited in This Space |-- ActiveMQ-CPP 2.1 RC1 now available was created by tabish121 (03:49 PM). | http://cwiki.apache.org/confluence/display/AMQCPP/2007/07/26/ActiveMQ-CPP+2.1+RC1+now+available Apache Geronimo Project Management (GMOxPMGT) http://cwiki.apache.org/confluence/display/GMOxPMGT | |-Pages Added or Edited in This Space |-- SNAPSHOT dependencies that need to be released for Geronimo 2.0 was last edited by pkashyap (07:38 PM). | http://cwiki.apache.org/confluence/display/GMOxPMGT/SNAPSHOT+dependencies+that+need+to+be+released+for+Geronimo+2.0 Apache Geronimo v1.1 (GMOxDOC11) http://cwiki.apache.org/confluence/display/GMOxDOC11 | |-Pages Added or Edited in This Space |-- Using J2G was last edited by ginemesis (11:02 AM). | http://cwiki.apache.org/confluence/display/GMOxDOC11/Using+J2G Apache Struts 2 Documentation (WW) http://cwiki.apache.org/confluence/display/WW | |-Pages Added or Edited in This Space |-- Developing a Portlet using Eclipse was created by mrdon (06:58 PM). | http://cwiki.apache.org/confluence/display/WW/Developing+a+Portlet+using+Eclipse |-- Tutorials was last edited by mrdon (05:34 PM). | http://cwiki.apache.org/confluence/display/WW/Tutorials |-- OGNL Basics was last edited by [EMAIL PROTECTED] (08:50 AM). | http://cwiki.apache.org/confluence/display/WW/OGNL+Basics | |-New Comments in This Space |-- http://cwiki.apache.org/confluence/display/WW/Portlet+Tutorial+%28WebWork+2.2%29 (1) |-- http://cwiki.apache.org/confluence/display/WW/AJAX (1) Apache Tuscany (TUSCANY) http://cwiki.apache.org/confluence/display/TUSCANY | |-Pages Added or Edited in This Space |-- Technology & Release was last edited by haleh (05:25 PM). | http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=55815 |-- Tuscany Downloads & Documentations was last edited by haleh (05:22 PM). | http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=55199 Apache Felix (FELIX) http://cwiki.apache.org/confluence/display/FELIX | |-Pages Added or Edited in This Space |-- Future Ideas was created by [EMAIL PROTECTED] (08:59 AM). | http://cwiki.apache.org/confluence/display/FELIX/Future+Ideas |-- iPOJO was last edited by [EMAIL PROTECTED] (08:59 AM). | http://cwiki.apache.org/confluence/display/FELIX/iPOJO OpenEJB (OPENEJB) http://cwiki.apache.org/confluence/display/OPENEJB | |-Pages Added or Edited in This Space |-- Configuration Properties was created by dblevins (04:08 PM). | http://cwiki.apache.org/confluence/display/OPENEJB/Configuration+Properties Apache Geronimo v2.0 (GMOxDOC20) http://cwiki.apache.org/confluence/display/GMOxDOC20 | |-Pages Added or Edited in This Space |-- Using JNDI in Geronimo 2.0 was last edited by vhnguyen (11:23 AM). | http://cwiki.apache.org/confluence/display/GMOxDOC20/Using+JNDI+in+Geronimo+2.0 |-- Using J2G was created by ginemesis (11:09 AM). | http://cwiki.apache.org/confluence/disp
svn commit: r560261 - in /struts/struts2/trunk/core/src/main: java/org/apache/struts2/interceptor/debugging/ resources/org/apache/struts2/interceptor/debugging/
Author: musachy Date: Fri Jul 27 07:58:05 2007 New Revision: 560261 URL: http://svn.apache.org/viewvc?view=rev&rev=560261 Log: WW-2070 Add an object browser to the debugging interceptor Added: struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/debugging/ObjectToHTMLWriter.java struts/struts2/trunk/core/src/main/resources/org/apache/struts2/interceptor/debugging/browser.ftl Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/debugging/DebuggingInterceptor.java struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/debugging/PrettyPrintWriter.java Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/debugging/DebuggingInterceptor.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/debugging/DebuggingInterceptor.java?view=diff&rev=560261&r1=560260&r2=560261 == --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/debugging/DebuggingInterceptor.java (original) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/debugging/DebuggingInterceptor.java Fri Jul 27 07:58:05 2007 @@ -40,9 +40,9 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.struts2.ServletActionContext; +import org.apache.struts2.StrutsConstants; import org.apache.struts2.views.freemarker.FreemarkerManager; import org.apache.struts2.views.freemarker.FreemarkerResult; -import org.apache.struts2.StrutsConstants; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionInvocation; @@ -67,6 +67,10 @@ * the 'xml' mode is inserted at the top of the page. * command - Tests an OGNL expression and returns the * string result. Only used by the OGNL console. + * browser Shows field values of an object specified in the + * object parameter (#context by default). When the object + * parameters is set, the '#' character needs to be escaped to '%23'. Like + * debug=browser&object=%23parameters * * * @@ -97,11 +101,14 @@ private final static String XML_MODE = "xml"; private final static String CONSOLE_MODE = "console"; private final static String COMMAND_MODE = "command"; +private final static String BROWSER_MODE = "browser"; private final static String SESSION_KEY = "org.apache.struts2.interceptor.debugging.VALUE_STACK"; private final static String DEBUG_PARAM = "debug"; +private final static String OBJECT_PARAM = "object"; private final static String EXPRESSION_PARAM = "expression"; +private final static String DECORATE_PARAM = "decorate"; private boolean enableXmlWithConsole = false; @@ -140,7 +147,7 @@ * @see com.opensymphony.xwork2.interceptor.Interceptor#invoke(com.opensymphony.xwork2.ActionInvocation) */ public String intercept(ActionInvocation inv) throws Exception { - +boolean actionOnly = false; boolean cont = true; if (devMode) { final ActionContext ctx = ActionContext.getContext(); @@ -204,11 +211,53 @@ ex.printStackTrace(); } cont = false; +} else if (BROWSER_MODE.equals(type)) { +actionOnly = true; +inv.addPreResultListener( +new PreResultListener() { +public void beforeResult(ActionInvocation inv, String actionResult) { +String rootObjectExpression = getParameter(OBJECT_PARAM); +if (rootObjectExpression == null) +rootObjectExpression = "#context"; +String decorate = getParameter(DECORATE_PARAM); +ValueStack stack = (ValueStack) ctx.get(ActionContext.VALUE_STACK); +Object rootObject = stack.findValue(rootObjectExpression); + +try { +StringWriter writer = new StringWriter(); +ObjectToHTMLWriter htmlWriter = new ObjectToHTMLWriter(writer); +htmlWriter.write(rootObject, rootObjectExpression); +String html = writer.toString(); +writer.close(); + +stack.set("debugHtml", html); + +//on the first request, response can be decorated +//but we need plain text on the other ones +if ("false".equals(decorate)) + ServletActionContext.getRequest().setAttribute("decorator", "none"); +
svn commit: r560260 - in /struts/struts2/branches/STRUTS_2_0_X/core/src: main/java/org/apache/struts2/components/ main/resources/template/simple/ test/java/org/apache/struts2/views/jsp/ui/ test/resour
Author: rgielen Date: Fri Jul 27 07:57:26 2007 New Revision: 560260 URL: http://svn.apache.org/viewvc?view=rev&rev=560260 Log: WW-2007: Fixing problems with generated javascript idetitifiers containing unescaped id parameter value Added: struts/struts2/branches/STRUTS_2_0_X/core/src/test/resources/org/apache/struts2/views/jsp/ui/ComboBox-4.txt Modified: struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/components/UIBean.java struts/struts2/branches/STRUTS_2_0_X/core/src/main/resources/template/simple/combobox.ftl struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/ui/ComboBoxTest.java Modified: struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/components/UIBean.java URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/components/UIBean.java?view=diff&rev=560260&r1=560259&r2=560260 == --- struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/components/UIBean.java (original) +++ struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/components/UIBean.java Fri Jul 27 07:57:26 2007 @@ -852,7 +852,8 @@ /** * Create HTML id element for the component and populate this component parmaeter - * map. + * map. Additionally, a parameter named escapedId is populated which contains the found id value filtered by + * [EMAIL PROTECTED] #escape(String)}, needed eg. for naming Javascript identifiers based on the id value. * * The order is as follows :- * @@ -864,19 +865,22 @@ * @param form */ protected void populateComponentHtmlId(Form form) { +String tryId; if (id != null) { // this check is needed for backwards compatibility with 2.1.x if (altSyntax()) { -addParameter("id", findString(id)); +tryId = findString(id); } else { -addParameter("id", id); +tryId = id; } } else if (form != null) { -addParameter("id", form.getParameters().get("id") + "_" -+ escape(name != null ? findString(name) : null)); +tryId = form.getParameters().get("id") + "_" ++ escape(name != null ? findString(name) : null); } else { -addParameter("id", escape(name != null ? findString(name) : null)); +tryId = escape(name != null ? findString(name) : null); } +addParameter("id", tryId); +addParameter("escapedId", escape(tryId)); } @StrutsTagAttribute(description="The template directory.") Modified: struts/struts2/branches/STRUTS_2_0_X/core/src/main/resources/template/simple/combobox.ftl URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/core/src/main/resources/template/simple/combobox.ftl?view=diff&rev=560260&r1=560259&r2=560260 == --- struts/struts2/branches/STRUTS_2_0_X/core/src/main/resources/template/simple/combobox.ftl (original) +++ struts/struts2/branches/STRUTS_2_0_X/core/src/main/resources/template/simple/combobox.ftl Fri Jul 27 07:57:26 2007 @@ -21,7 +21,7 @@ */ --> - function autoPopulate_${parameters.id?html}(targetElement) { + function autoPopulate_${parameters.escapedId?html}(targetElement) { <#if parameters.headerKey?exists && parameters.headerValue?exists> if (targetElement.options[targetElement.selectedIndex].value == '${parameters.headerKey?html}') { return; @@ -38,7 +38,7 @@ <#include "/${parameters.templateDir}/simple/text.ftl" />
<#if parameters.list?exists> - + <#if parameters.disabled?default(false)> disabled="disabled"<#rt/> #if> Modified: struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/ui/ComboBoxTest.java URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/ui/ComboBoxTest.java?view=diff&rev=560260&r1=560259&r2=560260 == --- struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/ui/ComboBoxTest.java (original) +++ struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/ui/ComboBoxTest.java Fri Jul 27 07:57:26 2007 @@ -140,4 +140,26 @@
svn commit: r560258 - in /struts/struts2/trunk/core/src: main/java/org/apache/struts2/components/ main/resources/template/simple/ test/java/org/apache/struts2/views/jsp/ui/ test/resources/org/apache/s
Author: rgielen Date: Fri Jul 27 07:56:11 2007 New Revision: 560258 URL: http://svn.apache.org/viewvc?view=rev&rev=560258 Log: WW-2007: Fixing problems with generated javascript idetitifiers containing unescaped id parameter value Added: struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/ComboBox-4.txt Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/UIBean.java struts/struts2/trunk/core/src/main/resources/template/simple/combobox.ftl struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/ComboBoxTest.java Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/UIBean.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/UIBean.java?view=diff&rev=560258&r1=560257&r2=560258 == --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/UIBean.java (original) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/UIBean.java Fri Jul 27 07:56:11 2007 @@ -902,7 +902,8 @@ /** * Create HTML id element for the component and populate this component parmaeter - * map. + * map. Additionally, a parameter named escapedId is populated which contains the found id value filtered by + * [EMAIL PROTECTED] #escape(String)}, needed eg. for naming Javascript identifiers based on the id value. * * The order is as follows :- * @@ -914,21 +915,24 @@ * @param form */ protected void populateComponentHtmlId(Form form) { +String tryId; if (id != null) { // this check is needed for backwards compatibility with 2.1.x if (altSyntax()) { -addParameter("id", findString(id)); +tryId = findString(id); } else { -addParameter("id", id); +tryId = id; } } else if (form != null) { -addParameter("id", form.getParameters().get("id") + "_" -+ escape(name != null ? findString(name) : null)); +tryId = form.getParameters().get("id") + "_" ++ escape(name != null ? findString(name) : null); } else { -addParameter("id", escape(name != null ? findString(name) : null)); +tryId = escape(name != null ? findString(name) : null); } +addParameter("id", tryId); +addParameter("escapedId", escape(tryId)); } - + /** * Get's the id for referencing element. * @return the id for referencing element. Modified: struts/struts2/trunk/core/src/main/resources/template/simple/combobox.ftl URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/template/simple/combobox.ftl?view=diff&rev=560258&r1=560257&r2=560258 == --- struts/struts2/trunk/core/src/main/resources/template/simple/combobox.ftl (original) +++ struts/struts2/trunk/core/src/main/resources/template/simple/combobox.ftl Fri Jul 27 07:56:11 2007 @@ -21,11 +21,11 @@ */ --> - function autoPopulate_${parameters.id?html}(targetElement) { + function autoPopulate_${parameters.escapedId?html}(targetElement) { <#if parameters.headerKey?exists && parameters.headerValue?exists> if (targetElement.options[targetElement.selectedIndex].value == '${parameters.headerKey?html}') { return; - } + } #if> <#if parameters.emptyOption?default(false)> if (targetElement.options[targetElement.selectedIndex].value == '') { @@ -38,7 +38,7 @@ <#include "/${parameters.templateDir}/simple/text.ftl" />
<#if parameters.list?exists> - + <#if parameters.disabled?default(false)> disabled="disabled"<#rt/> #if> Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/ComboBoxTest.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/ComboBoxTest.java?view=diff&rev=560258&r1=560257&r2=560258 == --- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/ComboBoxTest.java (original) +++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/ComboBoxTest.java Fri Jul 27 07:56:11 2007 @@ -134,4 +134,26 @@
Issues Closed: week of 2007-07-27
Struts2 - Friday, July 27, 2007 19 closed in last 7 days [WW-1911] File Upload: content-type validation fails when no file is uploaded James Holmes - Bug - [2.0.10] http://issues.apache.org/struts/browse/WW-1911 [WW-1938] Bug with multiple s:param tags inside s:url tag James Holmes - Bug - [2.0.10, 2.1.0] http://issues.apache.org/struts/browse/WW-1938 [WW-2051] add additional javascript hooks for optiontransferselect James Holmes - Improvement - [2.0.9, 2.1.0] http://issues.apache.org/struts/browse/WW-2051 [WW-2055] template.simple.doubleselect.ftl causes Javascript error when the name attribute of is setted to ".xx" Musachy Barroso - Bug - [] http://issues.apache.org/struts/browse/WW-2055 [WW-1371] struts layout tabs with missing borders on 2nd tab. Unassigned - Bug - [Future] http://issues.apache.org/struts/browse/WW-1371 [WW-2023] links in the portlet demo doing nothing James Holmes - Bug - [] http://issues.apache.org/struts/browse/WW-2023 [WW-1624] URL tag should support not escaping ampersand Unassigned - Improvement - [2.0.10, 2.1.0] http://issues.apache.org/struts/browse/WW-1624 [WW-2008] s:div, s:a loadingText=image bug Unassigned - Bug - [Future] http://issues.apache.org/struts/browse/WW-2008 [WW-1724] No content-type header in Tiles Result response Antonio Petrelli - Bug - [2.0.9] http://issues.apache.org/struts/browse/WW-1724 [WW-1528] AutocompleterTag missing setter for openTemplate attribute. James Holmes - Bug - [Future] http://issues.apache.org/struts/browse/WW-1528 [WW-2064] XHTML checkbox template does not include tooltip consistently James Holmes - Bug - [2.0.10, 2.1.0] http://issues.apache.org/struts/browse/WW-2064 [WW-2038] Extra carriage returns in simple theme templates James Holmes - Bug - [2.0.10, 2.1.0] http://issues.apache.org/struts/browse/WW-2038 [WW-2027] Tags that push values into the value stack should use the "var" attribute to specify the name of the variable Musachy Barroso - Improvement - [2.1.0] http://issues.apache.org/struts/browse/WW-2027 [WW-2007] ComboBoxTag: Textfield population fails for property names containing . (dot) Rene Gielen - Bug - [2.0.10, 2.1.0] http://issues.apache.org/struts/browse/WW-2007 [WW-2057] Can anyone tell me how to use fix font and color only for labels Unassigned - Temp - [] http://issues.apache.org/struts/browse/WW-2057 [WW-1976] FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl James Holmes - Bug - [2.0.10] http://issues.apache.org/struts/browse/WW-1976 [WW-2021] missing jar for direct web remoting (DWR) for the portlet demo James Holmes - Bug - [] http://issues.apache.org/struts/browse/WW-2021 [WW-1893] Rendered HTML contains line breaks inside tags Unassigned - Improvement - [2.0.8] http://issues.apache.org/struts/browse/WW-1893 [WW-1974] Struts 2.0.9 omnibus ticket Unassigned - Task - [2.0.9] http://issues.apache.org/struts/browse/WW-1974
svn commit: r560333 - /struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js
Author: musachy Date: Fri Jul 27 10:40:09 2007 New Revision: 560333 URL: http://svn.apache.org/viewvc?view=rev&rev=560333 Log: WW-2050 Separate JSONValidationInterceptor from AnnotationValidationInterceptor Patch provided by Lukasz Racon Modified: struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js Modified: struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js?view=diff&rev=560333&r1=560332&r2=560333 == --- struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js (original) +++ struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/Bind.js Fri Jul 27 10:40:09 2007 @@ -297,6 +297,7 @@ } var tmpHref = this.href; + tmpHref = tmpHref + (tmpHref.indexOf("?") > -1 ? "&" : "?") + "struts.enableJSONValidation=true"; if(!this.ajaxAfterValidation && this.validate) { tmpHref = tmpHref + (tmpHref.indexOf("?") > -1 ? "&" : "?") + "struts.validateOnly=true"; }
svn commit: r560334 - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Div.java
Author: musachy Date: Fri Jul 27 10:40:52 2007 New Revision: 560334 URL: http://svn.apache.org/viewvc?view=rev&rev=560334 Log: Update tag description Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Div.java Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Div.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Div.java?view=diff&rev=560334&r1=560333&r2=560334 == --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Div.java (original) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/Div.java Fri Jul 27 10:40:52 2007 @@ -33,7 +33,7 @@ * * */ [EMAIL PROTECTED](name="div", tldTagClass="org.apache.struts2.views.jsp.ui.DivTag", description="Render HTML div providing content from remote call via AJAX") [EMAIL PROTECTED](name="div", tldTagClass="org.apache.struts2.views.jsp.ui.DivTag", description="Render an HTML div") public class Div extends ClosingUIBean { public static final String TEMPLATE = "div";
svn commit: r560331 - in /struts/struts2/trunk/apps/showcase/src/main: resources/struts-ajax.xml webapp/validation/quiz-ajax.jsp
Author: musachy Date: Fri Jul 27 10:38:35 2007 New Revision: 560331 URL: http://svn.apache.org/viewvc?view=rev&rev=560331 Log: WW-2050 Separate JSONValidationInterceptor from AnnotationValidationInterceptor Patch provided by Lukasz Racon Modified: struts/struts2/trunk/apps/showcase/src/main/resources/struts-ajax.xml struts/struts2/trunk/apps/showcase/src/main/webapp/validation/quiz-ajax.jsp Modified: struts/struts2/trunk/apps/showcase/src/main/resources/struts-ajax.xml URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/resources/struts-ajax.xml?view=diff&rev=560331&r1=560330&r2=560331 == --- struts/struts2/trunk/apps/showcase/src/main/resources/struts-ajax.xml (original) +++ struts/struts2/trunk/apps/showcase/src/main/resources/struts-ajax.xml Fri Jul 27 10:38:35 2007 @@ -76,6 +76,7 @@ +/validation/quiz-ajax.jsp /validation/quiz-success.jsp Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/validation/quiz-ajax.jsp URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/validation/quiz-ajax.jsp?view=diff&rev=560331&r1=560330&r2=560331 == --- struts/struts2/trunk/apps/showcase/src/main/webapp/validation/quiz-ajax.jsp (original) +++ struts/struts2/trunk/apps/showcase/src/main/webapp/validation/quiz-ajax.jsp Fri Jul 27 10:38:35 2007 @@ -5,8 +5,8 @@ -Validation -Ajax - +Validation - Ajax +
svn commit: r560329 - in /struts/struts2/trunk/core/src/main: java/org/apache/struts2/interceptor/validation/JSONValidationInterceptor.java resources/struts-default.xml
Author: musachy Date: Fri Jul 27 10:38:24 2007 New Revision: 560329 URL: http://svn.apache.org/viewvc?view=rev&rev=560329 Log: WW-2050 Separate JSONValidationInterceptor from AnnotationValidationInterceptor Patch provided by Lukasz Racon Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptor.java struts/struts2/trunk/core/src/main/resources/struts-default.xml 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?view=diff&rev=560329&r1=560328&r2=560329 == --- 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 Fri Jul 27 10:38:24 2007 @@ -36,21 +36,41 @@ import com.opensymphony.xwork2.Action; import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.ValidationAware; +import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor; /** - * Extends the annotations validator and returns a JSON string with the - * validation errors. If validation succeeds the action is invoked. + * 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 + * + *+ * + * * 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 * validation (action won't be executed). + * + * A request parameter named 'enableJSONValidation' must be set to 'true' to + * use this interceptor */ -public class JSONValidationInterceptor extends AnnotationValidationInterceptor { +public class JSONValidationInterceptor extends MethodFilterInterceptor { private static final Log LOG = LogFactory .getLog(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; @@ -65,33 +85,34 @@ @Override protected String doIntercept(ActionInvocation invocation) throws Exception { -//validate -doBeforeInvocation(invocation); - HttpServletResponse response = ServletActionContext.getResponse(); HttpServletRequest request = ServletActionContext.getRequest(); Object action = invocation.getAction(); - -if (action instanceof ValidationAware) { -// generate json -ValidationAware validationAware = (ValidationAware) action; -if (validationAware.hasErrors()) { -if (validationFailedStatus >= 0) -response.setStatus(validationFailedStatus); -response.getWriter().print(buildResponse(validationAware)); +String jsonEnabled = request.getParameter(VALIDATE_JSON_PARAM); + +if (jsonEnabled != null && "true".equals(jsonEnabled)) { +if (action instanceof ValidationAware) { +// generate json +ValidationAware validationAware = (ValidationAware) action; +if (validationAware.hasErrors()) { +if (validationFailedStatus >= 0) +response.setStatus(validationFailedStatus); +response.getWriter().print(buildResponse(validationAware)); +return Action.NONE; +} +} + +String validateOnly = request.getParameter(VALIDATE_ONLY_PARAM); +if (validateOnly != null && "true".equals(validateOnly)) { +//there were no errors +response.getWriter().print("/* {} */"); return Action.NONE; -} -} - -String validateOnly = request.getParameter(VALIDATE_ONLY_PARAM); -if (validateOnly != null && "true".equals(validateOnly)) { -//there were no errors -response.getWrit+ * + *input,back,cancel + * + *+ * + *
svn commit: r560339 - /struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptorTest.java
Author: musachy Date: Fri Jul 27 10:57:41 2007 New Revision: 560339 URL: http://svn.apache.org/viewvc?view=rev&rev=560339 Log: WW-2050 Separate JSONValidationInterceptor from AnnotationValidationInterceptor Patch provided by Lukasz Racon Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptorTest.java Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptorTest.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptorTest.java?view=diff&rev=560339&r1=560338&r2=560339 == --- struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptorTest.java (original) +++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/validation/JSONValidationInterceptorTest.java Fri Jul 27 10:57:41 2007 @@ -53,10 +53,17 @@ private StrutsMockHttpServletResponse response; private JSONValidationInterceptor interceptor; private StrutsMockHttpServletRequest request; +private AnnotationValidationInterceptor validationInterceptor; public void testValidationFails() throws Exception { - + action.addActionError("General error"); + +Map parameters = new HashMap(); +parameters.put("struts.enableJSONValidation", "true"); +request.setParameterMap(parameters); + +validationInterceptor.intercept(invocation); interceptor.setValidationFailedStatus(HttpServletResponse.SC_BAD_REQUEST); interceptor.intercept(invocation); @@ -68,7 +75,7 @@ //json assertEquals(normalizedExpected, normalizedActual); //execution -assertFalse(invocation.isExecuted()); +assertFalse(action.isExecuted()); //http status assertEquals(HttpServletResponse.SC_BAD_REQUEST, response.getStatus()); } @@ -78,14 +85,18 @@ action.setText("[EMAIL PROTECTED]"); action.setValue(10); + +Map parameters = new HashMap(); +parameters.put("struts.enableJSONValidation", "true"); +request.setParameterMap(parameters); +validationInterceptor.intercept(invocation); interceptor.intercept(invocation); String json = stringWriter.toString(); String normalizedActual = TestUtils.normalize(json, true); assertEquals("", normalizedActual); -assertTrue(invocation.isExecuted()); } public void testValidationSucceedsValidateOnly() throws Exception { @@ -97,22 +108,24 @@ //just validate Map parameters = new HashMap(); parameters.put("struts.validateOnly", "true"); +parameters.put("struts.enableJSONValidation", "true"); request.setParameterMap(parameters); +validationInterceptor.intercept(invocation); interceptor.intercept(invocation); String json = stringWriter.toString(); String normalizedActual = TestUtils.normalize(json, true); assertEquals("/*{}*/", normalizedActual); -assertFalse(invocation.isExecuted()); +assertFalse(action.isExecuted()); } protected void setUp() throws Exception { super.setUp(); this.action = new TestAction(); this.interceptor = new JSONValidationInterceptor(); - +this.validationInterceptor = new AnnotationValidationInterceptor(); this.request = new StrutsMockHttpServletRequest(); stringWriter = new StringWriter(); PrintWriter writer = new PrintWriter(stringWriter); @@ -129,21 +142,11 @@ StrutsMockServletContext servletContext = new StrutsMockServletContext(); context.put(StrutsStatics.SERVLET_CONTEXT, servletContext); -invocation = new MockActionInvocation() { -private boolean executed; - -public String invoke() throws Exception { -executed = true; -return "success"; -} - -public boolean isExecuted() { -return executed; -} -}; +invocation = new MockActionInvocation(); invocation.setAction(action); invocation.setInvocationContext(context); MockActionProxy proxy = new MockActionProxy(); +proxy.setMethod("execute"); proxy.setAction(action); invocation.setProxy(proxy); } @@ -152,8 +155,10 @@ public static class TestAction extends ActionSupport { private String text = "x"; private int value = -10; - +private boolean executed = false; + public String execute() { +executed = true; return Action.SUCCESS; } @@ -179,6 +184,10 @@ @IntRangeFieldVali
svn commit: r560385 - /struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/views/jsp/ui/AnchorTag.java
Author: musachy Date: Fri Jul 27 14:13:04 2007 New Revision: 560385 URL: http://svn.apache.org/viewvc?view=rev&rev=560385 Log: WW-2048 AnchorTag has no setter method corresponding to TLD declared attribute 'onLoadJS' Modified: struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/views/jsp/ui/AnchorTag.java Modified: struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/views/jsp/ui/AnchorTag.java URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/views/jsp/ui/AnchorTag.java?view=diff&rev=560385&r1=560384&r2=560385 == --- struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/views/jsp/ui/AnchorTag.java (original) +++ struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/views/jsp/ui/AnchorTag.java Fri Jul 27 14:13:04 2007 @@ -36,7 +36,6 @@ private static final long serialVersionUID = -1034616578492431113L; protected String targets; -protected String preInvokeJS; public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) { return new Anchor(stack, req, res); @@ -56,6 +55,11 @@ @Deprecated() public void setPreInvokeJS(String preInvokeJS) { this.beforeLoading = preInvokeJS; +} + +@Deprecated() +public void setOnLoadJS(String onLoadJS) { +this.afterLoading = onLoadJS; } }