Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion helloworld/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<version>8.1.16.v20140903</version>
<configuration>
<webApp>
<contextPath>/${artifactId}</contextPath>
<contextPath>/${project.artifactId}</contextPath>
</webApp>
<stopKey>CTRL+C</stopKey>
<stopPort>8999</stopPort>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,29 @@
*/
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() {
messageStore = new MessageStore() ;

return SUCCESS;
}

public MessageStore getMessageStore() {
return messageStore;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,15 @@
*
*/
public class MessageStore {

private String message;

public MessageStore() {

setMessage("Hello Struts User");
}

private String message;

public MessageStore() {
message = "Hello Struts User";
}

public String getMessage() {
return message;
}

public void setMessage(String message) {
this.message = message;
}
public String getMessage() {
return message;
}

}
21 changes: 10 additions & 11 deletions helloworld/src/main/webapp/HelloWorld.jsp
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Hello World!</title>
</head>
<body>
<h2><s:property value="messageStore.message" /></h2>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Hello World!</title>
</head>
<body>
<h2><s:property value="messageStore.message" /></h2>
</body>
</html>
23 changes: 11 additions & 12 deletions helloworld/src/main/webapp/index.jsp
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Basic Struts 2 Application - Welcome</title>
</head>
<body>
<h1>Welcome To Struts 2!</h1>
<p><a href="<s:url action='hello'/>">Hello World</a></p>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Basic Struts 2 Application - Welcome</title>
</head>
<body>
<h1>Welcome To Struts 2!</h1>
<p><a href="<s:url action='hello'/>">Hello World</a></p>
</body>
</html>