Author: husted Date: Mon Feb 13 11:10:33 2006 New Revision: 377468 URL: http://svn.apache.org/viewcvs?rev=377468&view=rev Log: Cancellable * Update DTD to support new cancellable property * Add failing test page to Exercises to demonstrate exception handling (once implemented). cookbook * Fix action path reference.
Modified: struts/action/trunk/conf/java/struts-config_1_3.dtd struts/apps/trunk/cookbook/src/webapp/WEB-INF/struts-config.xml struts/apps/trunk/examples/src/java/org/apache/struts/webapp/exercise/MessageResources.properties struts/apps/trunk/examples/src/webapp/WEB-INF/exercise/struts-config.xml struts/apps/trunk/examples/src/webapp/exercise/index.html 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=377468&r1=377467&r2=377468&view=diff ============================================================================== --- struts/action/trunk/conf/java/struts-config_1_3.dtd (original) +++ struts/action/trunk/conf/java/struts-config_1_3.dtd Mon Feb 13 11:10:33 2006 @@ -333,6 +333,13 @@ the bean's specified "name". Optional if "name" is specified, else not valid. + cancellable Set to "true" if the Action can be cancelled. By default, + when an Action is cancelled, validation is bypassed + and the Action should not execute the business operation. + If a request tries to cancel an Action when cancellable + is not set, a "InvalidCancelException" is thrown. + [false] + catalog The name of a commons-chain catalog in which to look up a command to be executed as part of servicing this request. Only meaningful if "command" is also specified. @@ -425,6 +432,7 @@ <!ELEMENT action (icon?, display-name?, description?, set-property*, exception*, forward*)> <!ATTLIST action id ID #IMPLIED> <!ATTLIST action attribute %BeanName; #IMPLIED> +<!ATTLIST action cancellable %Boolean; #IMPLIED> <!ATTLIST action catalog CDATA #IMPLIED> <!ATTLIST action className %ClassName; #IMPLIED> <!ATTLIST action command CDATA #IMPLIED> Modified: struts/apps/trunk/cookbook/src/webapp/WEB-INF/struts-config.xml URL: http://svn.apache.org/viewcvs/struts/apps/trunk/cookbook/src/webapp/WEB-INF/struts-config.xml?rev=377468&r1=377467&r2=377468&view=diff ============================================================================== --- struts/apps/trunk/cookbook/src/webapp/WEB-INF/struts-config.xml (original) +++ struts/apps/trunk/cookbook/src/webapp/WEB-INF/struts-config.xml Mon Feb 13 11:10:33 2006 @@ -85,7 +85,7 @@ <!-- ========== Global Forward Definitions ============================= --> <global-forwards> - <forward name="home" path="/home.do"/> + <forward name="home" path="/Home.do"/> </global-forwards> <!-- ========== Action Mapping Definitions ============================= --> Modified: struts/apps/trunk/examples/src/java/org/apache/struts/webapp/exercise/MessageResources.properties URL: http://svn.apache.org/viewcvs/struts/apps/trunk/examples/src/java/org/apache/struts/webapp/exercise/MessageResources.properties?rev=377468&r1=377467&r2=377468&view=diff ============================================================================== --- struts/apps/trunk/examples/src/java/org/apache/struts/webapp/exercise/MessageResources.properties (original) +++ struts/apps/trunk/examples/src/java/org/apache/struts/webapp/exercise/MessageResources.properties Mon Feb 13 11:10:33 2006 @@ -6,6 +6,7 @@ errors.footer=</table> errors.prefix=<tr><td> errors.suffix=</td></tr> +errors.cancel=Cancellable not set for this action: {0} property1error1=Property 1, Error 1 property2error1=Property 2, Error 1 Modified: struts/apps/trunk/examples/src/webapp/WEB-INF/exercise/struts-config.xml URL: http://svn.apache.org/viewcvs/struts/apps/trunk/examples/src/webapp/WEB-INF/exercise/struts-config.xml?rev=377468&r1=377467&r2=377468&view=diff ============================================================================== --- struts/apps/trunk/examples/src/webapp/WEB-INF/exercise/struts-config.xml (original) +++ struts/apps/trunk/examples/src/webapp/WEB-INF/exercise/struts-config.xml Mon Feb 13 11:10:33 2006 @@ -24,6 +24,15 @@ <action-mappings> <action path="/welcome" forward="/index.html" /> <action path="/bean-write-2" forward="/bean-write-2.jsp" /> + <action path="/html-cancel" forward="/html-cancel.jsp"/> + <!-- --> + <action path="/html-cancel-submit" name="testbean" input="/html-cancel.jsp" cancellable="false" validate="true" forward="/welcome.do"> + <exception + key="errors.cancel" + type="org.apache.struts.action.InvalidCancelException" + path="/html-cancel.jsp"/> + </action> + <action path="/html-img" forward="/html-img.jsp" /> <!-- :FIXME: ImageAction should compute module prefix --> <action path="/html-img-action" type="org.apache.struts.webapp.exercise.ImageAction" parameter="/exercise/struts-power.gif"/> Modified: struts/apps/trunk/examples/src/webapp/exercise/index.html URL: http://svn.apache.org/viewcvs/struts/apps/trunk/examples/src/webapp/exercise/index.html?rev=377468&r1=377467&r2=377468&view=diff ============================================================================== --- struts/apps/trunk/examples/src/webapp/exercise/index.html (original) +++ struts/apps/trunk/examples/src/webapp/exercise/index.html Mon Feb 13 11:10:33 2006 @@ -42,6 +42,8 @@ <h3>HTML Tags</h3> <ul> + <li><a href="html-cancel.do"><html:cancel></a></li> + <li><a href="html-img.do"><html:img></a></li> <li><a href="html-link.do"><html:link></a></li> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]