Repository: struts-examples Updated Branches: refs/heads/master 51a2f1874 -> 15c545e0d
changed indentation in java files Project: http://git-wip-us.apache.org/repos/asf/struts-examples/repo Commit: http://git-wip-us.apache.org/repos/asf/struts-examples/commit/7f6f7c8c Tree: http://git-wip-us.apache.org/repos/asf/struts-examples/tree/7f6f7c8c Diff: http://git-wip-us.apache.org/repos/asf/struts-examples/diff/7f6f7c8c Branch: refs/heads/master Commit: 7f6f7c8c3ab05704c87a96e863124c42a47263f6 Parents: 51a2f18 Author: Stefaan Dutry <stefaan.du...@gmail.com> Authored: Sun Apr 23 17:52:51 2017 +0200 Committer: Stefaan Dutry <stefaan.du...@gmail.com> Committed: Sun Apr 23 17:52:51 2017 +0200 ---------------------------------------------------------------------- .../helloworld/action/HelloWorldAction.java | 107 +++++++++---------- .../struts/helloworld/model/MessageStore.java | 35 +++--- 2 files changed, 67 insertions(+), 75 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7f6f7c8c/coding-actions/src/main/java/org/apache/struts/helloworld/action/HelloWorldAction.java ---------------------------------------------------------------------- diff --git a/coding-actions/src/main/java/org/apache/struts/helloworld/action/HelloWorldAction.java b/coding-actions/src/main/java/org/apache/struts/helloworld/action/HelloWorldAction.java index 1285010..95b7408 100644 --- a/coding-actions/src/main/java/org/apache/struts/helloworld/action/HelloWorldAction.java +++ b/coding-actions/src/main/java/org/apache/struts/helloworld/action/HelloWorldAction.java @@ -13,67 +13,62 @@ import org.apache.struts.helloworld.model.MessageStore; */ 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; - } + 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; - } - - private String userName; + public void setHelloCount(int helloCount) { + HelloWorldAction.helloCount = helloCount; + } + + private String userName; - public String getUserName() { - return userName; - } + public String getUserName() { + return userName; + } - public void setUserName(String userName) { - this.userName = userName; - } + public void setUserName(String userName) { + this.userName = userName; + } - /* - * 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() ; - - //Action included a query string parameter of userName - //or a form field with name of userName - if (userName != null) { - - messageStore.setMessage( messageStore.getMessage() + " " + userName); - - } - - helloCount++; - - return SUCCESS; - } + /* + * 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() ; + + //Action included a query string parameter of userName + //or a form field with name of userName + if (userName != null) { + messageStore.setMessage( messageStore.getMessage() + " " + userName); + } + + helloCount++; + + return SUCCESS; + } - public MessageStore getMessageStore() { - return messageStore; - } + public MessageStore getMessageStore() { + return messageStore; + } - public void setMessageStore(MessageStore messageStore) { - this.messageStore = messageStore; - } - - + public void setMessageStore(MessageStore messageStore) { + this.messageStore = messageStore; + } } http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7f6f7c8c/coding-actions/src/main/java/org/apache/struts/helloworld/model/MessageStore.java ---------------------------------------------------------------------- diff --git a/coding-actions/src/main/java/org/apache/struts/helloworld/model/MessageStore.java b/coding-actions/src/main/java/org/apache/struts/helloworld/model/MessageStore.java index b7fceeb..d732494 100644 --- a/coding-actions/src/main/java/org/apache/struts/helloworld/model/MessageStore.java +++ b/coding-actions/src/main/java/org/apache/struts/helloworld/model/MessageStore.java @@ -6,26 +6,23 @@ package org.apache.struts.helloworld.model; * */ 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)"; + } }