From 06c4deda76ae90512db8b2f246d89e3a417b86cc Mon Sep 17 00:00:00 2001 From: Stefaan Dutry Date: Mon, 17 Apr 2017 15:22:24 +0200 Subject: [PATCH 1/6] changed tabs to spaces --- .../helloworld/action/HelloWorldAction.java | 58 +++++++++---------- .../struts/helloworld/model/MessageStore.java | 25 ++++---- 2 files changed, 40 insertions(+), 43 deletions(-) diff --git a/helloworld/src/main/java/org/apache/struts/helloworld/action/HelloWorldAction.java b/helloworld/src/main/java/org/apache/struts/helloworld/action/HelloWorldAction.java index b96dbdaf..8073413e 100755 --- a/helloworld/src/main/java/org/apache/struts/helloworld/action/HelloWorldAction.java +++ b/helloworld/src/main/java/org/apache/struts/helloworld/action/HelloWorldAction.java @@ -14,35 +14,33 @@ */ 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; - - /* - * Creates the MessageStore model object 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() ; - 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; + + /* + * Creates the MessageStore model object 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() ; + return SUCCESS; + } + + public MessageStore getMessageStore() { + return messageStore; + } + + public void setMessageStore(MessageStore messageStore) { + this.messageStore = messageStore; + } } diff --git a/helloworld/src/main/java/org/apache/struts/helloworld/model/MessageStore.java b/helloworld/src/main/java/org/apache/struts/helloworld/model/MessageStore.java index 03d87d33..cb70e510 100755 --- a/helloworld/src/main/java/org/apache/struts/helloworld/model/MessageStore.java +++ b/helloworld/src/main/java/org/apache/struts/helloworld/model/MessageStore.java @@ -6,20 +6,19 @@ * */ 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 void setMessage(String message) { + this.message = message; + } } From 47ad79f1736e26075fd06de551ef3c369ef20977 Mon Sep 17 00:00:00 2001 From: Stefaan Dutry Date: Mon, 17 Apr 2017 15:25:24 +0200 Subject: [PATCH 2/6] removed unnecessary setter --- .../apache/struts/helloworld/action/HelloWorldAction.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/helloworld/src/main/java/org/apache/struts/helloworld/action/HelloWorldAction.java b/helloworld/src/main/java/org/apache/struts/helloworld/action/HelloWorldAction.java index 8073413e..8d55e223 100755 --- a/helloworld/src/main/java/org/apache/struts/helloworld/action/HelloWorldAction.java +++ b/helloworld/src/main/java/org/apache/struts/helloworld/action/HelloWorldAction.java @@ -30,8 +30,8 @@ public class HelloWorldAction extends ActionSupport { * @see com.opensymphony.xwork2.ActionSupport#execute() */ public String execute() throws Exception { - messageStore = new MessageStore() ; + return SUCCESS; } @@ -39,8 +39,4 @@ public MessageStore getMessageStore() { return messageStore; } - public void setMessageStore(MessageStore messageStore) { - this.messageStore = messageStore; - } - } From 3e31be74a4f7d694fbe5628c0a4a32262a55945d Mon Sep 17 00:00:00 2001 From: Stefaan Dutry Date: Mon, 17 Apr 2017 15:27:20 +0200 Subject: [PATCH 3/6] removed unnecessary throws statement --- .../org/apache/struts/helloworld/action/HelloWorldAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helloworld/src/main/java/org/apache/struts/helloworld/action/HelloWorldAction.java b/helloworld/src/main/java/org/apache/struts/helloworld/action/HelloWorldAction.java index 8d55e223..d098c073 100755 --- a/helloworld/src/main/java/org/apache/struts/helloworld/action/HelloWorldAction.java +++ b/helloworld/src/main/java/org/apache/struts/helloworld/action/HelloWorldAction.java @@ -29,7 +29,7 @@ public class HelloWorldAction extends ActionSupport { * (non-Javadoc) * @see com.opensymphony.xwork2.ActionSupport#execute() */ - public String execute() throws Exception { + public String execute() { messageStore = new MessageStore() ; return SUCCESS; From a7c5f3049e97695cbbbfdbb3564d7a033e40e7cd Mon Sep 17 00:00:00 2001 From: Stefaan Dutry Date: Mon, 17 Apr 2017 15:32:20 +0200 Subject: [PATCH 4/6] changed deprecated ${artifactId} to ${project.artifactId} --- helloworld/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helloworld/pom.xml b/helloworld/pom.xml index b304d550..a7fb8da2 100644 --- a/helloworld/pom.xml +++ b/helloworld/pom.xml @@ -25,7 +25,7 @@ 8.1.16.v20140903 - /${artifactId} + /${project.artifactId} CTRL+C 8999 From 8d530157fed0df9442fb897478195889428de0f3 Mon Sep 17 00:00:00 2001 From: Stefaan Dutry Date: Mon, 17 Apr 2017 15:40:37 +0200 Subject: [PATCH 5/6] removed unnecessary setter --- .../org/apache/struts/helloworld/model/MessageStore.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/helloworld/src/main/java/org/apache/struts/helloworld/model/MessageStore.java b/helloworld/src/main/java/org/apache/struts/helloworld/model/MessageStore.java index cb70e510..e52fa89e 100755 --- a/helloworld/src/main/java/org/apache/struts/helloworld/model/MessageStore.java +++ b/helloworld/src/main/java/org/apache/struts/helloworld/model/MessageStore.java @@ -10,15 +10,11 @@ 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; - } - } From 6d98cba65f4065d84c2f0b889c77d76f81ef0c47 Mon Sep 17 00:00:00 2001 From: Stefaan Dutry Date: Mon, 17 Apr 2017 16:35:37 +0200 Subject: [PATCH 6/6] updated jsps: UTF-8, html5, indentation --- helloworld/src/main/webapp/HelloWorld.jsp | 21 ++++++++++----------- helloworld/src/main/webapp/index.jsp | 23 +++++++++++------------ 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/helloworld/src/main/webapp/HelloWorld.jsp b/helloworld/src/main/webapp/HelloWorld.jsp index f795612d..db8e040e 100755 --- a/helloworld/src/main/webapp/HelloWorld.jsp +++ b/helloworld/src/main/webapp/HelloWorld.jsp @@ -1,13 +1,12 @@ -<%@ 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! - - -

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

+ + diff --git a/helloworld/src/main/webapp/index.jsp b/helloworld/src/main/webapp/index.jsp index 6dc1e780..de471eda 100755 --- a/helloworld/src/main/webapp/index.jsp +++ b/helloworld/src/main/webapp/index.jsp @@ -1,14 +1,13 @@ -<%@ 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 - - -

Welcome To Struts 2!

-

Hello World

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

Welcome To Struts 2!

+

Hello World

+ +