From 141802c3884bf53c92c802ddd35ef6ae25250f74 Mon Sep 17 00:00:00 2001 From: Stefaan Dutry Date: Wed, 19 Apr 2017 22:26:07 +0200 Subject: [PATCH 1/9] changed indentation (tabs to spaces) --- .../helloworld/action/HelloWorldAction.java | 87 +++++++++---------- .../helloworld/model/MessageStore.java | 35 ++++---- 2 files changed, 58 insertions(+), 64 deletions(-) diff --git a/using-tags/src/main/java/org/apache/struts/using_tags/helloworld/action/HelloWorldAction.java b/using-tags/src/main/java/org/apache/struts/using_tags/helloworld/action/HelloWorldAction.java index 2a777be0..8a37129d 100644 --- a/using-tags/src/main/java/org/apache/struts/using_tags/helloworld/action/HelloWorldAction.java +++ b/using-tags/src/main/java/org/apache/struts/using_tags/helloworld/action/HelloWorldAction.java @@ -14,49 +14,46 @@ */ public class HelloWorldAction extends ActionSupport { - private static final long serialVersionUID = 1L; - - /** - * The model class that stores the message - * to display in the view. - */ - private MessageStore messageStore; - - private static int helloCount = 0; - - public int getHelloCount() { - return helloCount; - } - - public void setHelloCount(int helloCount) { - HelloWorldAction.helloCount = helloCount; - } - - /* - * Creates the MessageStore model object, - * increase helloCount by 1 and - * returns success. The MessageStore model - * object will be available to the view. - * (non-Javadoc) - * @see com.opensymphony.xwork2.ActionSupport#execute() - */ - public String execute() throws Exception { - - messageStore = new MessageStore() ; - - helloCount++; - - return SUCCESS; - } - - public MessageStore getMessageStore() { - return messageStore; - } - - public void setMessageStore(MessageStore messageStore) { - this.messageStore = messageStore; - } - - - + private static final long serialVersionUID = 1L; + + /** + * The model class that stores the message + * to display in the view. + */ + private MessageStore messageStore; + + private static int helloCount = 0; + + public int getHelloCount() { + return helloCount; + } + + public void setHelloCount(int helloCount) { + HelloWorldAction.helloCount = helloCount; + } + + /* + * Creates the MessageStore model object, + * increase helloCount by 1 and + * returns success. The MessageStore model + * object will be available to the view. + * (non-Javadoc) + * @see com.opensymphony.xwork2.ActionSupport#execute() + */ + public String execute() throws Exception { + messageStore = new MessageStore() ; + + helloCount++; + + return SUCCESS; + } + + public MessageStore getMessageStore() { + return messageStore; + } + + public void setMessageStore(MessageStore messageStore) { + this.messageStore = messageStore; + } + } diff --git a/using-tags/src/main/java/org/apache/struts/using_tags/helloworld/model/MessageStore.java b/using-tags/src/main/java/org/apache/struts/using_tags/helloworld/model/MessageStore.java index 8870513e..b14f7669 100644 --- a/using-tags/src/main/java/org/apache/struts/using_tags/helloworld/model/MessageStore.java +++ b/using-tags/src/main/java/org/apache/struts/using_tags/helloworld/model/MessageStore.java @@ -6,26 +6,23 @@ * */ public class MessageStore { - - private String message; - - public MessageStore() { - - setMessage("Hello Struts User"); - } + + private String message; + + public MessageStore() { + setMessage("Hello Struts User"); + } - public String getMessage() { - return message; - } + public String getMessage() { + return message; + } - public void setMessage(String message) { - this.message = message; - } - - public String toString() { - - return message + " (from toString)"; - - } + public void setMessage(String message) { + this.message = message; + } + + public String toString() { + return message + " (from toString)"; + } } From bfea188e35d816b90994786f475c6164506a7f40 Mon Sep 17 00:00:00 2001 From: Stefaan Dutry Date: Wed, 19 Apr 2017 22:36:38 +0200 Subject: [PATCH 2/9] tried adding some form of indentation to jsps --- using-tags/src/main/webapp/HelloWorld.jsp | 23 ++++++------ using-tags/src/main/webapp/index.jsp | 44 ++++++++++------------- 2 files changed, 30 insertions(+), 37 deletions(-) diff --git a/using-tags/src/main/webapp/HelloWorld.jsp b/using-tags/src/main/webapp/HelloWorld.jsp index 108810cc..7f39cf68 100644 --- a/using-tags/src/main/webapp/HelloWorld.jsp +++ b/using-tags/src/main/webapp/HelloWorld.jsp @@ -1,15 +1,14 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="s" uri="/struts-tags" %> - - -Hello World! - - -

-

I've said hello times!

-

- - \ No newline at end of file + + + Hello World! + + +

+

I've said hello times!

+

+ + diff --git a/using-tags/src/main/webapp/index.jsp b/using-tags/src/main/webapp/index.jsp index f9bcea24..114b5344 100644 --- a/using-tags/src/main/webapp/index.jsp +++ b/using-tags/src/main/webapp/index.jsp @@ -1,28 +1,22 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="s" uri="/struts-tags" %> - - -Basic Struts 2 Application - Welcome - - -

Welcome To Struts 2!

-

Hello World

- - Bruce Phillips - -

Hello Bruce Phillips

- -

Get your own personal hello by filling out and submitting this form.

- - - - - - - - - - \ No newline at end of file + + + Basic Struts 2 Application - Welcome + + +

Welcome To Struts 2!

+

Hello World

+ + Bruce Phillips + +

Hello Bruce Phillips

+

Get your own personal hello by filling out and submitting this form.

+ + + + + + From 03e6bd8164e8482b476a718204ff026a9147307b Mon Sep 17 00:00:00 2001 From: Stefaan Dutry Date: Wed, 19 Apr 2017 22:41:09 +0200 Subject: [PATCH 3/9] changed formatting for struts.xml --- using-tags/src/main/resources/struts.xml | 33 ++++++++++-------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/using-tags/src/main/resources/struts.xml b/using-tags/src/main/resources/struts.xml index be7c92c5..8711da37 100644 --- a/using-tags/src/main/resources/struts.xml +++ b/using-tags/src/main/resources/struts.xml @@ -1,27 +1,22 @@ - + "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN" + "http://struts.apache.org/dtds/struts-2.5.dtd"> + - - - - + - - /index.jsp - - - - - /HelloWorld.jsp - - - + + /index.jsp + - \ No newline at end of file + + + /HelloWorld.jsp + + + From 7e2b1caac5c44811407d9d4c23800566c9e22241 Mon Sep 17 00:00:00 2001 From: Stefaan Dutry Date: Wed, 19 Apr 2017 22:51:23 +0200 Subject: [PATCH 4/9] fixed javadoc object type name --- .../struts/using_tags/helloworld/action/HelloWorldAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/using-tags/src/main/java/org/apache/struts/using_tags/helloworld/action/HelloWorldAction.java b/using-tags/src/main/java/org/apache/struts/using_tags/helloworld/action/HelloWorldAction.java index 8a37129d..c4d320fa 100644 --- a/using-tags/src/main/java/org/apache/struts/using_tags/helloworld/action/HelloWorldAction.java +++ b/using-tags/src/main/java/org/apache/struts/using_tags/helloworld/action/HelloWorldAction.java @@ -7,7 +7,7 @@ /** * Acts as a Struts 2 controller that responds * to a user action by setting the value - * of the Message model class, and returns a String + * of the MessageStore model class, and returns a String * result. * @author Bruce Phillips * From 1010c52435587c9470880db15267062c98362eb1 Mon Sep 17 00:00:00 2001 From: Stefaan Dutry Date: Wed, 19 Apr 2017 22:55:29 +0200 Subject: [PATCH 5/9] removed unnecessary setter --- .../struts/using_tags/helloworld/action/HelloWorldAction.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/using-tags/src/main/java/org/apache/struts/using_tags/helloworld/action/HelloWorldAction.java b/using-tags/src/main/java/org/apache/struts/using_tags/helloworld/action/HelloWorldAction.java index c4d320fa..835dc564 100644 --- a/using-tags/src/main/java/org/apache/struts/using_tags/helloworld/action/HelloWorldAction.java +++ b/using-tags/src/main/java/org/apache/struts/using_tags/helloworld/action/HelloWorldAction.java @@ -52,8 +52,4 @@ public MessageStore getMessageStore() { return messageStore; } - public void setMessageStore(MessageStore messageStore) { - this.messageStore = messageStore; - } - } From f4fb7dfb95496d152f8f23f8029a7ba85e07cc1e Mon Sep 17 00:00:00 2001 From: Stefaan Dutry Date: Wed, 19 Apr 2017 22:59:24 +0200 Subject: [PATCH 6/9] removed unnecessary setter --- .../struts/using_tags/helloworld/model/MessageStore.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/using-tags/src/main/java/org/apache/struts/using_tags/helloworld/model/MessageStore.java b/using-tags/src/main/java/org/apache/struts/using_tags/helloworld/model/MessageStore.java index b14f7669..68712815 100644 --- a/using-tags/src/main/java/org/apache/struts/using_tags/helloworld/model/MessageStore.java +++ b/using-tags/src/main/java/org/apache/struts/using_tags/helloworld/model/MessageStore.java @@ -10,17 +10,13 @@ public class MessageStore { private String message; public MessageStore() { - setMessage("Hello Struts User"); + message = "Hello Struts User"; } public String getMessage() { return message; } - public void setMessage(String message) { - this.message = message; - } - public String toString() { return message + " (from toString)"; } From 404319bf2ba114eea3a7aacc1d98252f73f2da17 Mon Sep 17 00:00:00 2001 From: Stefaan Dutry Date: Wed, 19 Apr 2017 23:22:31 +0200 Subject: [PATCH 7/9] changed encoding to UTF-8 --- using-tags/src/main/webapp/HelloWorld.jsp | 4 ++-- using-tags/src/main/webapp/index.jsp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/using-tags/src/main/webapp/HelloWorld.jsp b/using-tags/src/main/webapp/HelloWorld.jsp index 7f39cf68..f05ae12e 100644 --- a/using-tags/src/main/webapp/HelloWorld.jsp +++ b/using-tags/src/main/webapp/HelloWorld.jsp @@ -1,9 +1,9 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags" %> - + Hello World! diff --git a/using-tags/src/main/webapp/index.jsp b/using-tags/src/main/webapp/index.jsp index 114b5344..9967f3c2 100644 --- a/using-tags/src/main/webapp/index.jsp +++ b/using-tags/src/main/webapp/index.jsp @@ -1,9 +1,9 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags" %> - + Basic Struts 2 Application - Welcome From 72c31f2b1fa72213d2ee827338c7eca2e5039f69 Mon Sep 17 00:00:00 2001 From: Stefaan Dutry Date: Wed, 19 Apr 2017 23:29:14 +0200 Subject: [PATCH 8/9] changed doctype to html5 --- using-tags/src/main/webapp/HelloWorld.jsp | 2 +- using-tags/src/main/webapp/index.jsp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/using-tags/src/main/webapp/HelloWorld.jsp b/using-tags/src/main/webapp/HelloWorld.jsp index f05ae12e..e6006f31 100644 --- a/using-tags/src/main/webapp/HelloWorld.jsp +++ b/using-tags/src/main/webapp/HelloWorld.jsp @@ -1,6 +1,6 @@ <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags" %> - + diff --git a/using-tags/src/main/webapp/index.jsp b/using-tags/src/main/webapp/index.jsp index 9967f3c2..6c6fa806 100644 --- a/using-tags/src/main/webapp/index.jsp +++ b/using-tags/src/main/webapp/index.jsp @@ -1,6 +1,6 @@ <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags" %> - + From 18affab89c9bfad8c7c0cecdbb313142cc4394cb Mon Sep 17 00:00:00 2001 From: Stefaan Dutry Date: Wed, 19 Apr 2017 23:51:31 +0200 Subject: [PATCH 9/9] changed deprecated artifactId to project.artifactId --- using-tags/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/using-tags/pom.xml b/using-tags/pom.xml index b649c448..0414941b 100644 --- a/using-tags/pom.xml +++ b/using-tags/pom.xml @@ -25,7 +25,7 @@ 8.1.16.v20140903 - /${artifactId} + /${project.artifactId} CTRL+C 8999