Skip to content

Commit 13a3b92

Browse files
committed
Moves JSPs under /WEB-INF to promote good practises
1 parent 90eb79a commit 13a3b92

File tree

10 files changed

+40
-40
lines changed

10 files changed

+40
-40
lines changed

archetypes/struts2-archetype-blank/src/main/resources/archetype-resources/src/main/resources/example.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
<default-action-ref name="HelloWorld" />
1313

1414
<action name="HelloWorld" class="${package}.example.HelloWorld">
15-
<result>/example/HelloWorld.jsp</result>
15+
<result>/WEB-INF/example/HelloWorld.jsp</result>
1616
</action>
1717

1818
<action name="Login_*" method="{1}" class="${package}.example.Login">
19-
<result name="input">/example/Login.jsp</result>
19+
<result name="input">/WEB-INF/example/Login.jsp</result>
2020
<result type="redirectAction">Menu</result>
2121
</action>
2222

2323
<action name="*" class="${package}.example.ExampleSupport">
24-
<result>/example/{1}.jsp</result>
24+
<result>/WEB-INF/example/{1}.jsp</result>
2525
</action>
2626

2727
<!-- Add additional "example" package actions here. -->

archetypes/struts2-archetype-starter/src/main/resources/archetype-resources/src/main/resources/struts.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
<default-action-ref name="index" />
1313

1414
<action name="index" class="${package}.IndexAction">
15-
<result>/jsp/index.jsp</result>
15+
<result>/WEB-INF/jsp/index.jsp</result>
1616
</action>
1717

1818
<action name="helloWorld" class="helloWorldAction">
1919
<result name="input">/jsp/index.jsp</result>
20-
<result>/jsp/helloWorld.jsp</result>
20+
<result>/WEB-INF/jsp/helloWorld.jsp</result>
2121
</action>
2222

2323
</package>
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
<!DOCTYPE html PUBLIC
2-
"-//W3C//DTD XHTML 1.1 Transitional//EN"
3-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4-
5-
<%@taglib prefix="s" uri="/struts-tags" %>
6-
7-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
8-
<head>
9-
<title>Hello World</title>
10-
<s:head />
11-
</head>
12-
<body>
13-
Hello <s:property value="name"/>, today is <s:property value="dateNow" /><br/>
14-
15-
</body>
16-
</html>
1+
<!DOCTYPE html PUBLIC
2+
"-//W3C//DTD XHTML 1.1 Transitional//EN"
3+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4+
5+
<%@taglib prefix="s" uri="/struts-tags" %>
6+
7+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
8+
<head>
9+
<title>Hello World</title>
10+
<s:head />
11+
</head>
12+
<body>
13+
Hello <s:property value="name"/>, today is <s:property value="dateNow" /><br/>
14+
15+
</body>
16+
</html>
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
<!DOCTYPE html PUBLIC
2-
"-//W3C//DTD XHTML 1.1 Transitional//EN"
3-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4-
5-
<%@taglib prefix="s" uri="/struts-tags" %>
6-
7-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
8-
<head>
9-
<title>Index</title>
10-
<s:head />
11-
</head>
12-
<body>
13-
<s:form action="helloWorld">
14-
<s:textfield label="What is your name?" name="name" />
15-
<s:textfield label="What is the date?" name="dateNow" />
16-
<s:submit />
17-
</s:form>
18-
</body>
19-
</html>
1+
<!DOCTYPE html PUBLIC
2+
"-//W3C//DTD XHTML 1.1 Transitional//EN"
3+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4+
5+
<%@taglib prefix="s" uri="/struts-tags" %>
6+
7+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
8+
<head>
9+
<title>Index</title>
10+
<s:head />
11+
</head>
12+
<body>
13+
<s:form action="helloWorld">
14+
<s:textfield label="What is your name?" name="name" />
15+
<s:textfield label="What is the date?" name="dateNow" />
16+
<s:submit />
17+
</s:form>
18+
</body>
19+
</html>
2020

0 commit comments

Comments
 (0)