You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by ma...@apache.org on 2004/02/20 13:42:52 UTC
cvs commit: jakarta-velocity-tools/examples/struts/WEB-INF/src/examples/app2 DemoAction.java DemoForm.java
marino 2004/02/20 04:42:52
Modified: examples/struts/WEB-INF/src/examples/app2 DemoAction.java
DemoForm.java
Log:
use Apache Software License 2.0
Revision Changes Path
1.4 +19 -9 jakarta-velocity-tools/examples/struts/WEB-INF/src/examples/app2/DemoAction.java
Index: DemoAction.java
===================================================================
RCS file: /home/cvs/jakarta-velocity-tools/examples/struts/WEB-INF/src/examples/app2/DemoAction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DemoAction.java 12 Feb 2004 00:20:25 -0000 1.3
+++ DemoAction.java 20 Feb 2004 12:42:52 -0000 1.4
@@ -1,7 +1,17 @@
/*
- * Struts Example Application 1
- *
- * This demonstrates the use of Velocity templates with the Struts framework.
+ * Copyright 2003-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 examples.app2;
@@ -26,7 +36,7 @@
* @author <a href="mailto:sidler@teamup.com"/>Gabe Sidler</a>
* @version $Id$
*/
-public class DemoAction extends Action
+public class DemoAction extends Action
{
/**
@@ -51,7 +61,7 @@
// Create serveral error messages to demontrate the output in a template
ActionErrors errors = new ActionErrors();
-
+
// Add some global errors
errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error01"));
errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error02"));
@@ -59,14 +69,14 @@
// Add some specific errors
errors.add("language", new ActionMessage("error10"));
errors.add("language", new ActionMessage("error11"));
-
+
// Save error messages to request attributes
saveErrors(request, errors);
// Create serveral error messages to demontrate the output in a template
ActionMessages messages = new ActionMessages();
-
+
// Add some global messages
messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("message01"));
messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("message02"));
@@ -74,7 +84,7 @@
// Add some specific messages
messages.add("foobar", new ActionMessage("message10"));
messages.add("foobar", new ActionMessage("message11"));
-
+
// Save messages to request attributes
saveMessages(request, messages);
1.2 +20 -11 jakarta-velocity-tools/examples/struts/WEB-INF/src/examples/app2/DemoForm.java
Index: DemoForm.java
===================================================================
RCS file: /home/cvs/jakarta-velocity-tools/examples/struts/WEB-INF/src/examples/app2/DemoForm.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DemoForm.java 6 Mar 2003 00:05:18 -0000 1.1
+++ DemoForm.java 20 Feb 2004 12:42:52 -0000 1.2
@@ -1,10 +1,19 @@
/*
- * Struts Example Application 2
- *
- * This demonstrates the use of Velocity templates with the Struts framework.
+ * Copyright 2003-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 examples.app2;
@@ -22,21 +31,21 @@
* @version $Id$
*/
-public final class DemoForm extends ActionForm
+public final class DemoForm extends ActionForm
{
// ---- Form fields -------------------------------------------------
-
+
private String language = "";
-
+
// ---- Accessor Methods --------------------------------------------
-
+
public String getLanguage()
{
return language;
}
-
+
public void setLanguage(String s)
{
language = s;
@@ -51,7 +60,7 @@
* @param mapping The mapping used to select this instance
* @param request The servlet request we are processing
*/
- public void reset(ActionMapping mapping, HttpServletRequest request)
+ public void reset(ActionMapping mapping, HttpServletRequest request)
{
language = "";
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org