Skip to content

Commit 6ff66c8

Browse files
committed
update readme
1 parent 2e8c7bf commit 6ff66c8

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,32 @@ Here's an example of some things to check after running the build script:
2525

2626
## Run
2727

28-
To run and test that Tomcat is serving the the war file:
28+
Here are the summarized commands to run and test that Tomcat is serving the war file:
2929

3030
docker run --rm -p 8080:8080 -d demo-java
3131
docker exec -ti $(docker ps -ql) bash
3232
curl localhost:8080/demo/Hello
33+
curl localhost:8080/demo/index.jsp
3334
exit
3435
docker stop $(docker ps -ql)
3536

3637
Then you can hit the the [HOSTNAME]:8080/demo/Hello and to verify that Tomcat is servering the demo.war file. You should see an html page that says "Hello World". The output should look similar:
3738

3839
$ docker run --rm -p 8080:8080 -d demo-java
39-
5ccc23ec07f2057ee530b9ad51714d4f07054d5c101ae407715aca33e5fffd69
40+
2ba7323481fa5c4068b90f2edf38555d9551303e9c2e4c27137ab0545688555b
4041
$ docker exec -ti $(docker ps -ql) bash
41-
root@5ccc23ec07f2:/usr/local/tomcat# curl localhost:8080/demo/Hello
42-
<h1>Hello World</h1>
43-
root@5ccc23ec07f2:/usr/local/tomcat# exit
42+
root@2ba7323481fa:/usr/local/tomcat# curl localhost:8080/demo/Hello
43+
<h1>Hello World Hello.java</h1>
44+
root@2ba7323481fa:/usr/local/tomcat# curl localhost:8080/demo/index.jsp
45+
<html>
46+
<body>
47+
<h2>Hello World index.jsp!</h2>
48+
</body>
49+
</html>
50+
root@2ba7323481fa:/usr/local/tomcat# exit
4451
exit
4552
$ docker stop $(docker ps -ql)
46-
5ccc23ec07f2
53+
2ba7323481fa
4754
$ docker ps -a
4855
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4956
$

src/main/java/Hello.class

986 Bytes
Binary file not shown.

src/main/java/Hello.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class Hello extends HttpServlet {
1010

1111
public void init() throws ServletException {
1212
// Do required initialization
13-
message = "Hello World";
13+
message = "Hello World Hello.java";
1414
}
1515

1616
public void doGet(HttpServletRequest request, HttpServletResponse response)

src/main/webapp/index.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<html>
22
<body>
3-
<h2>Hello World!</h2>
3+
<h2>Hello World index.jsp!</h2>
44
</body>
55
</html>

0 commit comments

Comments
 (0)