You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by hu...@apache.org on 2006/02/14 13:59:20 UTC

svn commit: r377714 - in /struts: action/trunk/src/java/org/apache/struts/action/ action/trunk/src/java/org/apache/struts/config/ apps/trunk/cookbook/src/webapp/WEB-INF/ apps/trunk/cookbook/src/webapp/jsp/localization/ apps/trunk/cookbook/src/webapp/js...

Author: husted
Date: Tue Feb 14 04:59:18 2006
New Revision: 377714

URL: http://svn.apache.org/viewcvs?rev=377714&view=rev
Log:
Action
* ActionConfig - Add Cancellable as an extends property 
* InvalidCancelException - Add header (thanks Niall!)
* Examples - Add missing html-cancel.jsp (and again!)
* Cookbook - Update links

Added:
    struts/apps/trunk/examples/src/webapp/exercise/html-cancel.jsp   (with props)
Modified:
    struts/action/trunk/src/java/org/apache/struts/action/InvalidCancelException.java
    struts/action/trunk/src/java/org/apache/struts/config/ActionConfig.java
    struts/apps/trunk/cookbook/src/webapp/WEB-INF/struts-config.xml
    struts/apps/trunk/cookbook/src/webapp/jsp/localization/source.jsp
    struts/apps/trunk/cookbook/src/webapp/jsp/messages/source.jsp
    struts/apps/trunk/cookbook/src/webapp/jsp/validator/source.jsp

Modified: struts/action/trunk/src/java/org/apache/struts/action/InvalidCancelException.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/action/InvalidCancelException.java?rev=377714&r1=377713&r2=377714&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/action/InvalidCancelException.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/action/InvalidCancelException.java Tue Feb 14 04:59:18 2006
@@ -1,3 +1,20 @@
+/*
+ * $Id: Action.java 376862 2006-02-10 21:14:54Z husted $
+ *
+ * Copyright 2000-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.struts.action;
 
 

Modified: struts/action/trunk/src/java/org/apache/struts/config/ActionConfig.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/config/ActionConfig.java?rev=377714&r1=377713&r2=377714&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/config/ActionConfig.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/config/ActionConfig.java Tue Feb 14 04:59:18 2006
@@ -983,6 +983,10 @@
             setAttribute(config.getAttribute());
         }
 
+        if (!getCancellable()) {
+            setCancellable(config.getCancellable());
+        }
+
         if (getCatalog() == null) {
             setCatalog(config.getCatalog());
         }
@@ -1062,7 +1066,7 @@
      * @see #inheritFrom(ActionConfig)
      */
     public void processExtends(ModuleConfig moduleConfig)
-        throws ClassNotFoundException, IllegalAccessException, 
+        throws ClassNotFoundException, IllegalAccessException,
             InstantiationException, InvocationTargetException {
         if (configured) {
             throw new IllegalStateException("Configuration is frozen");

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=377714&r1=377713&r2=377714&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 Tue Feb 14 04:59:18 2006
@@ -97,31 +97,32 @@
 
         <!-- Simple ActionForm Example ===================================== -->
 
-		<action path="/prepareSimple" 
+		<action path="/prepareSimple"
 				type="examples.SuccessAction">
 			<forward name="success" path="/jsp/simple/Simple.jsp"/>
 		</action>
 
-		<action path="/processSimple" 
-				type="examples.simple.ProcessSimpleAction" 
-				name="simpleForm" 
-				scope="request" 
+		<action path="/processSimple"
+				type="examples.simple.ProcessSimpleAction"
+				name="simpleForm"
+				scope="request"
 				input="/jsp/simple/Simple.jsp"
-				validate="true">
+                cancellable="true"
+                validate="true">
 			<forward name="success" path="/jsp/simple/SimpleResults.jsp"/>
 		</action>
 
 		<!-- DynaActionForm Example ======================================== -->
 
-		<action path="/prepareDyna" 
+		<action path="/prepareDyna"
 				type="examples.SuccessAction">
 			<forward name="success" path="/jsp/dyna/Dyna.jsp"/>
 		</action>
 
-		<action path="/processDyna" 
+		<action path="/processDyna"
 				type="examples.dyna.ProcessDynaAction"
-				name="dynaForm" 
-				scope="request" 
+				name="dynaForm"
+				scope="request"
 				input="/jsp/dyna/Dyna.jsp"
 				validate="false">
 			<forward name="success" path="/jsp/dyna/DynaResults.jsp"/>
@@ -129,15 +130,15 @@
 
 		<!-- Options Example =============================================== -->
 
-		<action path="/prepareOptions" 
+		<action path="/prepareOptions"
 				type="examples.options.PrepareOptionsAction">
 			<forward name="success" path="/jsp/options/Options.jsp"/>
 		</action>
 
-		<action path="/processOptions" 
-				type="examples.options.ProcessOptionsAction" 
-				name="optionsForm" 
-				scope="request" 
+		<action path="/processOptions"
+				type="examples.options.ProcessOptionsAction"
+				name="optionsForm"
+				scope="request"
 				input="/jsp/options/Options.jsp"
 				validate="false">
 			<forward name="success" path="/jsp/options/OptionsResults.jsp"/>
@@ -145,18 +146,18 @@
 
 		<!-- Mutibox Example =============================================== -->
 
-		<action path="/prepareMultibox" 
+		<action path="/prepareMultibox"
 				type="examples.multibox.PrepareMultiboxAction"
-				name="multiboxForm" 
-				scope="request" 
+				name="multiboxForm"
+				scope="request"
 				validate="false">
 			<forward name="success" path="/jsp/multibox/Multibox.jsp"/>
 		</action>
 
-		<action path="/processMultibox" 
-				type="examples.multibox.ProcessMultiboxAction" 
-				name="multiboxForm" 
-				scope="request" 
+		<action path="/processMultibox"
+				type="examples.multibox.ProcessMultiboxAction"
+				name="multiboxForm"
+				scope="request"
 				input="/jsp/multibox/Multibox.jsp"
 				validate="false">
 			<forward name="success" path="/jsp/multibox/MultiboxResults.jsp"/>
@@ -164,88 +165,89 @@
 
 		<!-- Bean Tags Example ============================================= -->
 
-		<action path="/prepareBean" 
+		<action path="/prepareBean"
 				type="examples.bean.PrepareBeanAction">
 			<forward name="success" path="/jsp/bean/Bean.jsp"/>
 		</action>
 
 		<!-- Links Tags Example ============================================ -->
 
-		<action path="/prepareLinks" 
+		<action path="/prepareLinks"
 				type="examples.links.PrepareLinksAction">
 			<forward name="success" path="/jsp/links/Links.jsp"/>
 		</action>
 
-		<action path="/processLinks" 
-				type="examples.links.ProcessLinksAction" 
-				name="testForm" 
-				scope="request" 
+		<action path="/processLinks"
+				type="examples.links.ProcessLinksAction"
+				name="testForm"
+				scope="request"
 				input="/jsp/links/Links.jsp"
 				validate="false">
 			<forward name="success" path="/jsp/links/LinksResults.jsp"/>
-		</action>	
+		</action>
 
 		<!-- Logic Tags Example ============================================ -->
 
-		<action path="/prepareLogic" 
+		<action path="/prepareLogic"
 				type="examples.logic.PrepareLogicAction">
 			<forward name="success" path="/jsp/logic/Logic.jsp"/>
 		</action>
 
 		<!-- Validator Example ============================================= -->
 
-		<action path="/prepareValidator" 
+		<action path="/prepareValidator"
 				type="examples.SuccessAction">
 			<forward name="success" path="/jsp/validator/Validator.jsp"/>
 		</action>
 
-		<action path="/processValidator" 
-				type="examples.validator.ProcessValidatorAction" 
-				name="validatorForm" 
-				scope="request" 
+		<action path="/processValidator"
+				type="examples.validator.ProcessValidatorAction"
+				name="validatorForm"
+				scope="request"
 				input="/jsp/validator/Validator.jsp"
-				validate="true">
+                cancellable="true"
+                validate="true">
 			<forward name="success" path="/jsp/validator/ValidatorResults.jsp"/>
-		</action>	
-		
+		</action>
+
 		<!-- Messages Tags Example ========================================= -->
 
-		<action path="/prepareMessages" 
+		<action path="/prepareMessages"
 				type="examples.SuccessAction">
 			<forward name="success" path="/jsp/messages/Messages.jsp"/>
 		</action>
-		
+
 		<!-- Localization Tags Example ===================================== -->
 
-		<action path="/prepareLocalization" 
+		<action path="/prepareLocalization"
 				type="examples.SuccessAction">
 			<forward name="success" path="/jsp/localization/Localization.jsp"/>
 		</action>
 
-		<action path="/processLocalization" 
-				type="examples.localization.ProcessLocalizationAction" 
-				name="testForm" 
-				scope="request" 
+		<action path="/processLocalization"
+				type="examples.localization.ProcessLocalizationAction"
+				name="testForm"
+				scope="request"
 				input="/jsp/localization/Localization.jsp"
 				validate="false">
 			<forward name="success" path="/jsp/localization/Localization.jsp"/>
 		</action>
-		
+
 		<!-- Token Tags Example ============================================ -->
 
-		<action path="/prepareToken" 
+		<action path="/prepareToken"
 				type="examples.token.PrepareTokenAction">
 			<forward name="success" path="/jsp/token/Token.jsp"/>
 		</action>
 
-		<action path="/processToken" 
-				type="examples.token.ProcessTokenAction" 
-				name="testForm" 
-				scope="request" 
+		<action path="/processToken"
+				type="examples.token.ProcessTokenAction"
+				name="testForm"
+				scope="request"
 				input="/jsp/token/Token.jsp"
 				validate="false">
 			<forward name="success" path="/jsp/token/TokenResults.jsp"/>
-		</action>		
+		</action>
 
 	</action-mappings>
 
@@ -255,7 +257,7 @@
 
   	<!-- ========== Plug Ins Configuration ================================== -->
   	<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
-		<set-property property="pathnames" 
+		<set-property property="pathnames"
 					  value="/org/apache/struts/validator/validator-rules.xml,
                    			 /WEB-INF/validation.xml" />
     </plug-in>

Modified: struts/apps/trunk/cookbook/src/webapp/jsp/localization/source.jsp
URL: http://svn.apache.org/viewcvs/struts/apps/trunk/cookbook/src/webapp/jsp/localization/source.jsp?rev=377714&r1=377713&r2=377714&view=diff
==============================================================================
--- struts/apps/trunk/cookbook/src/webapp/jsp/localization/source.jsp (original)
+++ struts/apps/trunk/cookbook/src/webapp/jsp/localization/source.jsp Tue Feb 14 04:59:18 2006
@@ -30,15 +30,15 @@
 
 <h2>Configuration files</h2>
 <p><html:link page="/source.jsp?src=/WEB-INF/struts-config.xml">struts-config.xml</html:link></p>
-<p><html:link page="/source.jsp?src=/WEB-INF/src/java/examples/ApplicationResources.properties">ApplicationResources.properties</html:link></p>
-<p><html:link page="/source.jsp?src=/WEB-INF/src/java/examples/ApplicationResources_en_CA.properties">ApplicationResources_en_CA.properties</html:link></p>
-<p><html:link page="/source.jsp?src=/WEB-INF/src/java/examples/ApplicationResources_en_US.properties">ApplicationResources_en_US.properties</html:link></p>
-<p><html:link page="/source.jsp?src=/WEB-INF/src/java/examples/ApplicationResources_en_GB.properties">ApplicationResources_en_GB.properties</html:link></p>
-<p><html:link page="/source.jsp?src=/WEB-INF/src/java/examples/ApplicationResources_fr.properties">ApplicationResources_fr.properties</html:link></p>
-<p><html:link page="/source.jsp?src=/WEB-INF/src/java/examples/ApplicationResources_de.properties">ApplicationResources_de.properties</html:link></p>
-<p><html:link page="/source.jsp?src=/WEB-INF/src/java/examples/ApplicationResources_es.properties">ApplicationResources_es.properties</html:link></p>
-<p><html:link page="/source.jsp?src=/WEB-INF/src/java/examples/ApplicationResources_it.properties">ApplicationResources_it.properties</html:link></p>
-<p><html:link page="/source.jsp?src=/WEB-INF/src/java/examples/ApplicationResources_pt.properties">ApplicationResources_pt.properties</html:link></p>
+<p><html:link page="/source.jsp?src=/WEB-INF/src/java/examples/MessageResources.properties">MessageResources.properties</html:link></p>
+<p><html:link page="/source.jsp?src=/WEB-INF/src/java/examples/MessageResources_en_CA.properties">MessageResources_en_CA.properties</html:link></p>
+<p><html:link page="/source.jsp?src=/WEB-INF/src/java/examples/MessageResources_en_US.properties">MessageResources_en_US.properties</html:link></p>
+<p><html:link page="/source.jsp?src=/WEB-INF/src/java/examples/MessageResources_en_GB.properties">MessageResources_en_GB.properties</html:link></p>
+<p><html:link page="/source.jsp?src=/WEB-INF/src/java/examples/MessageResources_fr.properties">MessageResources_fr.properties</html:link></p>
+<p><html:link page="/source.jsp?src=/WEB-INF/src/java/examples/MessageResources_de.properties">MessageResources_de.properties</html:link></p>
+<p><html:link page="/source.jsp?src=/WEB-INF/src/java/examples/MessageResources_es.properties">MessageResources_es.properties</html:link></p>
+<p><html:link page="/source.jsp?src=/WEB-INF/src/java/examples/MessageResources_it.properties">MessageResources_it.properties</html:link></p>
+<p><html:link page="/source.jsp?src=/WEB-INF/src/java/examples/MessageResources_pt.properties">MessageResources_pt.properties</html:link></p>
 
 <h2>Other source files</h2>
 <p>None</p>

Modified: struts/apps/trunk/cookbook/src/webapp/jsp/messages/source.jsp
URL: http://svn.apache.org/viewcvs/struts/apps/trunk/cookbook/src/webapp/jsp/messages/source.jsp?rev=377714&r1=377713&r2=377714&view=diff
==============================================================================
--- struts/apps/trunk/cookbook/src/webapp/jsp/messages/source.jsp (original)
+++ struts/apps/trunk/cookbook/src/webapp/jsp/messages/source.jsp Tue Feb 14 04:59:18 2006
@@ -11,7 +11,7 @@
 <link rel="stylesheet" type="text/css" href="../../css/example.css" />
 </head>
 <body>
-<html:link action="/processMessages">
+<html:link action="/prepareMessages">
 	   <img src="../../images/execute.gif" width="24" height="24" alt="Execute example" class="icon" />
 </html:link>
 <a href="../../index.jsp"><img src="../../images/return.gif" height="24" width="24" alt="Return to examples page" class="icon" /></a>
@@ -29,8 +29,7 @@
 
 <h2>Configuration files</h2>
 <p><html:link page="/source.jsp?src=/WEB-INF/struts-config.xml">struts-config.xml</html:link></p>
-<p><html:link page="/source.jsp?src=/WEB-INF/src/java/examples/ApplicationResources.properties">ApplicationResources.properties</html:link></p>
-src\java\examples
+<p><html:link page="/source.jsp?src=/WEB-INF/src/java/examples/MessageResources.properties">MessageResources.properties</html:link></p>
 
 <h2>Other source files</h2>
 <p>None</p>

Modified: struts/apps/trunk/cookbook/src/webapp/jsp/validator/source.jsp
URL: http://svn.apache.org/viewcvs/struts/apps/trunk/cookbook/src/webapp/jsp/validator/source.jsp?rev=377714&r1=377713&r2=377714&view=diff
==============================================================================
--- struts/apps/trunk/cookbook/src/webapp/jsp/validator/source.jsp (original)
+++ struts/apps/trunk/cookbook/src/webapp/jsp/validator/source.jsp Tue Feb 14 04:59:18 2006
@@ -32,7 +32,6 @@
 <h2>Configuration files</h2>
 <p><html:link page="/source.jsp?src=/WEB-INF/struts-config.xml">struts-config.xml</html:link></p>
 <p><html:link page="/source.jsp?src=/WEB-INF/validation.xml">validation.xml</html:link></p>
-<p><html:link page="/source.jsp?src=/WEB-INF/validator-rules.xml">validator-rules.xml</html:link></p>
 
 <h2>Other source files</h2>
 <p><html:link page="/source.jsp?src=/WEB-INF/src/java/examples/validator/CustomValidator.java">CustomValidator.java</html:link></p>

Added: 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=377714&view=auto
==============================================================================
--- struts/apps/trunk/examples/src/webapp/exercise/html-cancel.jsp (added)
+++ struts/apps/trunk/examples/src/webapp/exercise/html-cancel.jsp Tue Feb 14 04:59:18 2006
@@ -0,0 +1,53 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
+<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
+<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
+<html:html>
+    <head>
+        <title>
+            <title>Test struts-html:cancel Tag</title>
+        </title>
+        <html:base/>
+    </head>
+
+    <body bgcolor="white">
+    <html:errors/>
+
+    <logic:messagesPresent>
+        <bean:message key="errors.header"/>
+        <hr/>
+    </logic:messagesPresent>
+
+    <p>
+        Pressing the Cancel button should thrown an exception and display an
+        error
+        message, since Cancellable is not set for this Action.
+    </p>
+
+    <p>
+        <html:form action="/html-cancel-false">
+            <html:submit property="submit"/>
+            &#160;
+            <html:reset/>
+            <html:cancel/>
+        </html:form>
+    </p>
+
+    <hr/>
+
+    <p>
+        Pressing this Cancel button should return to the Welcome page,
+        as Cancellable is set to true for this Action.
+    </p>
+
+    <p>
+        <html:form action="/html-cancel-true">
+            <html:submit property="submit"/>
+            &#160;
+            <html:reset/>
+            <html:cancel/>
+        </html:form>
+    </p>
+
+    </body>
+</html:html>

Propchange: struts/apps/trunk/examples/src/webapp/exercise/html-cancel.jsp
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org