Author: niallp Date: Tue Feb 21 21:14:33 2006 New Revision: 379687 URL: http://svn.apache.org/viewcvs?rev=379687&view=rev Log: Add to "cancellable" test in struts-examples webapp
Modified: struts/apps/trunk/examples/src/webapp/WEB-INF/exercise/struts-config.xml struts/apps/trunk/examples/src/webapp/exercise/html-cancel.jsp 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=379687&r1=379686&r2=379687&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 Tue Feb 21 21:14:33 2006 @@ -39,6 +39,12 @@ type="org.apache.struts.action.InvalidCancelException" path="/html-cancel.jsp"/> </action> + <action path="/html-cancel-exception" name="testbean" + input="/html-cancel.jsp" cancellable="false" validate="true" + forward="/welcome.do"/> + <action path="/html-cancel-novalidate" name="testbean" + input="/html-cancel.jsp" cancellable="false" validate="false" + forward="/welcome.do"/> <action path="/html-img" forward="/html-img.jsp"/> Modified: struts/apps/trunk/examples/src/webapp/exercise/html-cancel.jsp URL: http://svn.apache.org/viewcvs/struts/apps/trunk/examples/src/webapp/exercise/html-cancel.jsp?rev=379687&r1=379686&r2=379687&view=diff ============================================================================== --- struts/apps/trunk/examples/src/webapp/exercise/html-cancel.jsp (original) +++ struts/apps/trunk/examples/src/webapp/exercise/html-cancel.jsp Tue Feb 21 21:14:33 2006 @@ -11,21 +11,47 @@ </head> <body bgcolor="white"> - <html:errors/> + + <p><strong>Cancel Not Allowed - Error Message</strong></p> + + <p> + Pressing the Cancel button should display an error + message, since Cancellable is not set for this Action + but an Exception handler has been configured to handle + the throw exception. + </p> <logic:messagesPresent> - <bean:message key="errors.header"/> - <hr/> + <p> + <font color="red"><strong> + <html:messages id="msg"> + <bean:write name="msg"/> + </html:messages> + </strong></font> + </p> </logic:messagesPresent> <p> - Pressing the Cancel button should thrown an exception and display an - error - message, since Cancellable is not set for this Action. + <html:form action="/html-cancel-false"> + <html:submit property="submit"/> +   + <html:reset/> + <html:cancel/> + </html:form> </p> + <hr/> + + <p><strong>Cancel Not Allowed - Exception</strong></p> <p> - <html:form action="/html-cancel-false"> + Pressing this Cancel button should throw an + <code>org.apache.struts.action.InvalidCancelException</code> + since Cancellable is not set for this Action and no exception + handler was configured. + </p> + + <p> + <html:form action="/html-cancel-exception"> <html:submit property="submit"/>   <html:reset/> @@ -35,6 +61,7 @@ <hr/> + <p><strong>Cancel Allowed (Validate true)</strong></p> <p> Pressing this Cancel button should return to the Welcome page, as Cancellable is set to true for this Action. @@ -42,6 +69,24 @@ <p> <html:form action="/html-cancel-true"> + <html:submit property="submit"/> +   + <html:reset/> + <html:cancel/> + </html:form> + </p> + <hr/> + + <p><strong>Cancel Not Allowed - Exception (Validate false)</strong></p> + <p> + Pressing this Cancel button should throw an + <code>org.apache.struts.action.InvalidCancelException</code> + since Cancellable is not set for this Action even though + the mapping is set to NOT validate. + </p> + + <p> + <html:form action="/html-cancel-novalidate"> <html:submit property="submit"/>   <html:reset/> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]