Author: husted
Date: Thu Aug 17 17:30:52 2006
New Revision: 432449
URL: http://svn.apache.org/viewvc?rev=432449&view=rev
Log:
WW-1340 Add "HelloWorld" code from "Step by Step" tutorial.
Added:
struts/sandbox/trunk/mailreader-course/struts2/hello/src/java/tutorial/
struts/sandbox/trunk/mailreader-course/struts2/hello/src/java/tutorial/HelloWorld.java
struts/sandbox/trunk/mailreader-course/struts2/hello/src/webapp/tutorial/
struts/sandbox/trunk/mailreader-course/struts2/hello/src/webapp/tutorial/HelloWorld.jsp
Modified:
struts/sandbox/trunk/mailreader-course/struts2/hello/src/java/struts.xml
Modified:
struts/sandbox/trunk/mailreader-course/struts2/hello/src/java/struts.xml
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/mailreader-course/struts2/hello/src/java/struts.xml?rev=432449&r1=432448&r2=432449&view=diff
==============================================================================
--- struts/sandbox/trunk/mailreader-course/struts2/hello/src/java/struts.xml
(original)
+++ struts/sandbox/trunk/mailreader-course/struts2/hello/src/java/struts.xml
Thu Aug 17 17:30:52 2006
@@ -16,4 +16,11 @@
<!-- Add your actions here -->
</package>
+
+ <package name="tutorial" extends="struts-default">
+ <action name="HelloWorld" class="tutorial.HelloWorld">
+ <result name="success">/tutorial/HelloWorld.jsp</result>
+ </action>
+ </package>
+
</struts>
Added:
struts/sandbox/trunk/mailreader-course/struts2/hello/src/java/tutorial/HelloWorld.java
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/mailreader-course/struts2/hello/src/java/tutorial/HelloWorld.java?rev=432449&view=auto
==============================================================================
---
struts/sandbox/trunk/mailreader-course/struts2/hello/src/java/tutorial/HelloWorld.java
(added)
+++
struts/sandbox/trunk/mailreader-course/struts2/hello/src/java/tutorial/HelloWorld.java
Thu Aug 17 17:30:52 2006
@@ -0,0 +1,25 @@
+package tutorial;
+
+import com.opensymphony.xwork2.Action;
+
+import java.text.DateFormat;
+import java.util.Date;
+
+public class HelloWorld implements Action {
+
+ public String execute() {
+ message = "Hello, World!\n";
+ message += "The time is:\n";
+ message += DateFormat.getDateInstance().format(new Date());
+ ;
+
+ return SUCCESS;
+ }
+
+ private String message;
+
+ public String getMessage() {
+ return message;
+ }
+
+}
\ No newline at end of file
Added:
struts/sandbox/trunk/mailreader-course/struts2/hello/src/webapp/tutorial/HelloWorld.jsp
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/mailreader-course/struts2/hello/src/webapp/tutorial/HelloWorld.jsp?rev=432449&view=auto
==============================================================================
---
struts/sandbox/trunk/mailreader-course/struts2/hello/src/webapp/tutorial/HelloWorld.jsp
(added)
+++
struts/sandbox/trunk/mailreader-course/struts2/hello/src/webapp/tutorial/HelloWorld.jsp
Thu Aug 17 17:30:52 2006
@@ -0,0 +1,11 @@
+<%@ taglib prefix="s" uri="/tags" %>
+<html>
+<head>
+ <title>Hello World</title>
+</head>
+
+<body>
+The message generated by my first Action is:
+<s:property value="message"/>
+</body>
+</html>
\ No newline at end of file