Author: husted Date: Thu Feb 16 06:12:52 2006 New Revision: 378250 URL: http://svn.apache.org/viewcvs?rev=378250&view=rev Log: Opt-In Cancel Handler * Update release notees * Update Action.isCancelled Javado * Also update the controller documentation in the DTD to reflect the new default processor
Modified: struts/action/trunk/conf/java/struts-config_1_3.dtd struts/action/trunk/src/java/org/apache/struts/action/Action.java struts/action/trunk/xdocs/userGuide/release-notes.xml Modified: struts/action/trunk/conf/java/struts-config_1_3.dtd URL: http://svn.apache.org/viewcvs/struts/action/trunk/conf/java/struts-config_1_3.dtd?rev=378250&r1=378249&r2=378250&view=diff ============================================================================== --- struts/action/trunk/conf/java/struts-config_1_3.dtd (original) +++ struts/action/trunk/conf/java/struts-config_1_3.dtd Thu Feb 16 06:12:52 2006 @@ -538,7 +538,7 @@ processorClass The fully qualified Java class name of the RequestProcessor subclass to be used with this module. - ["org.apache.struts.action.RequestProcessor"] + ["org.apache.struts.chain.ComposableRequestProcessor"] tempDir Temporary working directory to use when processing file uploads. Modified: struts/action/trunk/src/java/org/apache/struts/action/Action.java URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/action/Action.java?rev=378250&r1=378249&r2=378250&view=diff ============================================================================== --- struts/action/trunk/src/java/org/apache/struts/action/Action.java (original) +++ struts/action/trunk/src/java/org/apache/struts/action/Action.java Thu Feb 16 06:12:52 2006 @@ -351,6 +351,11 @@ * an <strong>ActionForm</strong>'s <code>validate()</code> method will * have been skipped by the controller servlet.</p> * + * <p> Since Action 1.3.0, the mapping for a cancellable Action must also have + * the new "cancellable" property set to true. If "cancellable" is not set, and + * the magic Cancel token is found in the request, the standard Composable + * Request Processor will throw an InvalidCancelException. </p> + * * @param request The servlet request we are processing * @return <code>true</code> if the cancel button was pressed; * <code>false</code> otherwise. Modified: struts/action/trunk/xdocs/userGuide/release-notes.xml URL: http://svn.apache.org/viewcvs/struts/action/trunk/xdocs/userGuide/release-notes.xml?rev=378250&r1=378249&r2=378250&view=diff ============================================================================== --- struts/action/trunk/xdocs/userGuide/release-notes.xml (original) +++ struts/action/trunk/xdocs/userGuide/release-notes.xml Thu Feb 16 06:12:52 2006 @@ -22,13 +22,40 @@ <title>Release Notes (since 1.2.8)</title> </properties> <body> - <section name="6.1 Release Notes - Version 1.3.0-dev"> + <section name="6.1 Release Notes - Version 1.3.0"> + + <subsection> + <p> + <strong>SPECIAL NOTE ON UPGRADING - README FIRST!</strong> + - If you use the standard + <strong>CANCEL BUTTON</strong> + in your application + and validate is set to true for that mapping, you + <strong>MUST</strong> + also specify "cancellable=true" in the mapping, otherwise, + an InvalidCancelException will be thrown if the Cancel button is + used. See the new + <a href="#opt-in">Opt-In Cancel Handling</a> + feature for more. + </p> + <p> + <source> + <action path="/ActionThatCanBeCancelled" + validate="true" + <strong>cancellable="true"</strong> + ... + </action> + </source> + </p> + </subsection> + <a name="release_notes"/> <subsection name="Introduction"> <p> This section contains release notes for changes that have taken - place to Struts Classic since + place to the seven new subprojects known as "Struts Classic" + since <a href="release-notes-1.2.8.html">Version 1.2.8</a> . To keep up-to-date on all changes to Struts, subscribe to @@ -70,7 +97,7 @@ dependencies. </p> <p> - You can also access to the Struts source repository and + You can also access to the Apache Struts source repository and change logs directly through both <a href="http://svn.apache.org/viewcvs.cgi/struts/action/trunk/?root=Apache-SVN"> web browser</a> @@ -107,8 +134,10 @@ . </p> <p> - We also welcome <i>Wendy Smoak's</i> acceptance to join the - Struts PMC (project management committee). + We also welcome + <i>Wendy Smoak's</i> + acceptance to join the + Apache Struts PMC (project management committee). </p> <h3>Struts Action Library</h3> @@ -136,7 +165,7 @@ </p> <p> - The Struts subprojects, including the website, are being + The Apache Struts subprojects, including the website, are being built with Maven. But, of course, you can continue to build your own projects any way you like!) @@ -160,32 +189,37 @@ </p> <h4>Software Component Changes</h4> <p> - Struts 1.3.0 has changed its dependency on the following - software components: + A number of software dependency changes apply to this release: <ul> <li> New dependency on Commons Chain 1.0 - see <a href="http://jakarta.apache.org/commons/chain/"> - Chain Website - </a>. + Chain Website + </a> + . </li> <li> Upgraded to Commons FileUpload 1.1 (previously 1.0) - see <a href="http://jakarta.apache.org/commons/fileupload/changes-report.html"> - FileUpload 1.1 Release Notes - </a>. + FileUpload 1.1 Release Notes + </a> + . </li> <li> - New dependency on Commons IO 1.1 (required by FileUpload 1.1) - see + New dependency on Commons IO 1.1 (required by FileUpload + 1.1) - see <a href="http://jakarta.apache.org/commons/io/"> - IO Website - </a>. + IO Website + </a> + . </li> <li> - Upgraded to Commons Validator 1.2 (previously 1.1.4) - see + Upgraded to Commons Validator 1.2 (previously 1.1.4) - + see <a href="http://jakarta.apache.org/commons/validator/changes-report.html"> - Validator 1.2.0 Release Notes - </a>. + Validator 1.2.0 Release Notes + </a> + . </li> </ul> </p> @@ -205,12 +239,24 @@ In MailReader, fix invalid password limit error. </li> <li> - The examples application's config files (struts + The examples application's config files (struts and validation) in the Validator module have been split into up into one per example page. </li> </ul> + <ul> + <li>In taglib-exercises, add html-cancel page to demonstrate + new <a href="#opt-in">Opt-In Cancel Handling</a>.</li> + </ul> + + <ul> + <li>In all applications, update configuration for new + <strong>cancellable</strong> + property as needed. + </li> + </ul> + <h3>Struts Action Framework</h3> <p> @@ -228,6 +274,9 @@ Catalog and Command Elements </li> <li> + Opt-In Cancel Handling + </li> + <li> Enhanced Global Exception Handlers </li> <li> @@ -272,7 +321,7 @@ } </source> <p> - For Struts 1.3, we turned the request processor methods + For Action 1.3, we turned the request processor methods into Commands that are part of a flexible Chain of Commands. Rather than subclassing a monolithic object, @@ -291,7 +340,7 @@ </chain> </source> <p> - We fully expect the Struts 1.3 request processor to be + We fully expect the Action 1.3 request processor to be backwardly compatible with earlier versions. But, to be prudent, we wanted to release 1.3 with the @@ -299,12 +348,30 @@ Request Processor before making additional changes. </p> <p> - We've made a few other changes and improvements in Struts + We've made a few other changes and improvements in Action 1.3.x, but the two big-ticket items are subprojects and the new request processor. </p> - + <p> + If needed, the monolithic RequestProcessor from Struts 1.2 is + still available in the distribution and may be + configured via the controller element. + </p> + <source> + <controller + processorClass="org.apache.struts.action.RequestProcessor" + /> + </source> + <p> + However, we consider this RequestProcessor to be a legacy + class. Once the new ComposableRequestProcessor is more-widely + field tested, we expect that this class will be deprecated, + moved to the Extras subproject, and ultimately removed. + Accordingly, some new features, like Opt-In Cancel + Handling, are only supported by the new Composable Request + Processor. + </p> <h4>Arbitrary configuration properties</h4> <p> @@ -337,6 +404,65 @@ and other members. </p> + <a name="opt-in" /> + <h4>Opt-In Cancel Handling</h4> + + <p> + <strong>SPECIAL NOTE ON UPGRADING - README FIRST!</strong> + - If you use the standard + <strong>CANCEL BUTTON</strong> + in your application + and validate is set to true for that mapping, you + <strong>MUST</strong> + also specify "cancellable=true" in the mapping, otherwise, + an InvalidCancelException will be thrown if the Cancel button is + used. Here's why: + </p> + + <p> + In Struts 1.2 and prior, any time the magic token generated by + the Cancel tag is found in the request, validation for the + ActionForm is skipped. + Accordingly, in Struts 1.2 and prior, any Action that relies on + validation should always observe the isCancelled method. + </p> + + <p> + In Struts Action 1.3, the Cancel token is only honored if the + new property "cancellable" is set for the Action Mapping. + If the Cancel token is present, but cancellable is not set, + then an InvalidCancelException is thrown. + The InvalidCancelExeption may be caught by a Declarative + Exception Handler, like any other Exception. + </p> + + <p> + <source> + <action path="/ActionThatCanBeCancelled" + validate="true" + <strong>cancellable="true"</strong> + ... > + <exception + key="errors.invalidCancel" + type="org.apache.struts.action.InvalidCancelException" + path="/InvalidCancelException.jsp"/> + </action> + </source> + </p> + + <p> + The declarative exception handler is optional. The Exception + will only be thrown when there is a programming error or + when a rogue client is trying to bypass validation. + </p> + + <p> + Note that the Opt-In Cancel Handler is available for the + <strong>Composable Request Processor only</strong>. + If you configure your application to use the legacy + Request Processor instead, the Struts 1.2 behavior is observed. + </p> + <h4>Enhanced Global Exception Handlers</h4> <p> We now support use of global exception handlers in cases @@ -351,7 +477,6 @@ or any of its superclasses. </p> - <h4>Catalog and Command elements</h4> <p> Available for both the Controller and any Action Mapping @@ -483,12 +608,16 @@ values through configuration. </li> <li> - Changed the MultipartRequestWrapper to extend the - HttpServletRequestWrapper which was introduced in Servlet 2.3. - This fixed the issue that MultipartRequestWrapper didn't support - Servlet 2.4 methods and means that mutlipart requests no longer - have to be "un-wrapped" before forwarding - now making parameters - parsed from the multipart request available after forwarding. + Changed the MultipartRequestWrapper to extend the + HttpServletRequestWrapper which was introduced in Servlet + 2.3. + This fixed the issue that MultipartRequestWrapper didn't + support + Servlet 2.4 methods and means that mutlipart requests no + longer + have to be "un-wrapped" before forwarding - now making + parameters + parsed from the multipart request available after forwarding. </li> <li> Added support for per-field character encoding in multipart @@ -614,8 +743,9 @@ javascript values. </li> <li> - Fixed the mis-leading warning message indicating a - missing form when dynamicJavascript is <code>false</code> + Fixed the mis-leading warning message indicating a + missing form when dynamicJavascript is + <code>false</code> in the JavascriptTag. </li> <li> @@ -624,7 +754,7 @@ </li> <li> Fixed indexed behaviour to check for JSTL's LoopTag rather - then LoopTagSupport to verify JSLT. + then LoopTagSupport to verify JSLT. </li> </ul> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]