Skip to content

Commit 039d3c0

Browse files
author
eugenp
committed
cleanup work for registrationg
1 parent b30114f commit 039d3c0

9 files changed

Lines changed: 64 additions & 63 deletions

File tree

‎spring-security-login-error-handling/src/main/webapp/WEB-INF/view/admin.jsp‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
2-
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
2+
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
33
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
44
<html>
5-
<sec:authorize ifAnyGranted ="ROLE_USER">
6-
<spring:message code="message.unauth" ></spring:message>
5+
<sec:authorize ifAnyGranted="ROLE_USER">
6+
<spring:message code="message.unauth"></spring:message>
77
</sec:authorize>
88
<head>
99
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
1010
</head>
1111

12-
1312
<body>
14-
15-
<head></head>
1613
<sec:authorize ifAnyGranted="ROLE_ADMIN">
17-
<H1> Hello Admin</H1>
18-
</sec:authorize>
19-
14+
<H1>Hello Admin</H1>
15+
</sec:authorize>
16+
2017
<a href="<c:url value="/j_spring_security_logout" />">Logout</a>
2118
<a href="<c:url value="/home.html" />">Home</a>
2219
</body>
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
2-
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
2+
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"%>
33
<html>
4+
45
<head>
56
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
67
</head>
@@ -10,16 +11,16 @@
1011

1112
<security:authorize access="hasRole('ROLE_USER')">
1213
This text is only visible to a user
13-
<br/>
14+
<br />
1415
</security:authorize>
1516

1617
<security:authorize access="hasRole('ROLE_ADMIN')">
1718
This text is only visible to an admin
18-
<br/>
19+
<br />
1920
</security:authorize>
2021

2122
<a href="<c:url value="/j_spring_security_logout" />">Logout</a>
2223
<a href="<c:url value="/admin.html" />">Administrator Page</a>
23-
2424
</body>
25+
2526
</html>
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
2-
<%@ page session="true" %>
1+
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
2+
<%@ page session="true"%>
33
<html>
4+
45
<head>
56
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
6-
<title>Home</title>
7+
<title>Home</title>
78
</head>
8-
<body>
9-
<h1>
10-
Welcome back home!
11-
</h1>
129

10+
<body>
11+
<h1>Welcome back home!</h1>
1312
</body>
13+
1414
</html>

‎spring-security-login-error-handling/src/main/webapp/WEB-INF/view/homepage.jsp‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
2-
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
3-
<%@ page session="true" %>
2+
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
3+
<%@ page session="true"%>
44
<html>
55
<head>
66
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
77
</head>
88

99
<body>
10-
<body>
1110
<h1>This is the homepage for the user</h1>
1211

1312
<sec:authorize access="hasRole('ROLE_USER')">
@@ -23,8 +22,6 @@
2322
<a href="<c:url value="/j_spring_security_logout" />">Logout</a>
2423
<a href="<c:url value="/home.html" />">Home</a>
2524
<a href="<c:url value="/admin.html" />">Administrator Page</a>
26-
2725
</body>
2826

29-
</body>
3027
</html>

‎spring-security-login-error-handling/src/main/webapp/WEB-INF/view/invalidSession.jsp‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
<html>
44
<head>
55
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
6-
<title>Home</title>
6+
<title>Home</title>
77
</head>
8-
<body>
9-
<h1 class="alert alert-error">
10-
<spring:message code="message.sessionExpired" ></spring:message>
11-
</h1>
128

9+
<body>
10+
<h1 class="alert alert-error">
11+
<spring:message code="message.sessionExpired"></spring:message>
12+
</h1>
1313
</body>
14+
1415
</html>
Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
2-
<%@ taglib prefix="sec"
3-
uri="http://www.springframework.org/security/tags"%>
2+
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
43
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
54
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
65
<fmt:setBundle basename="messages" />
@@ -9,6 +8,7 @@
98
<fmt:message key="message.password" var="noPass" />
109
<fmt:message key="message.username" var="noUser" />
1110
<html>
11+
1212
<head>
1313
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
1414
<c:if test="${param.error != null}">
@@ -29,7 +29,6 @@
2929
document.f.j_username.focus();
3030
return false;
3131
}
32-
3332
if (document.f.j_password.value == "") {
3433
alert("${noPass}");
3534
document.f.j_password.focus();
@@ -43,27 +42,26 @@
4342
<h1>Login</h1>
4443
<a href="?lang=en">English</a> |
4544
<a href="?lang=es_ES">Spanish</a>
46-
<form name='f' action="j_spring_security_check" method='POST'
47-
onsubmit="return validate();">
45+
<form name='f' action="j_spring_security_check" method='POST' onsubmit="return validate();">
4846

49-
<table>
50-
<tr>
51-
<td>User:</td>
52-
<td><input type='text' name='j_username' value=''></td>
53-
</tr>
54-
<tr>
55-
<td>Password:</td>
56-
<td><input type='password' name='j_password' /></td>
57-
</tr>
58-
<tr>
59-
<td><input name="submit" type="submit" value="submit" /></td>
60-
</tr>
61-
</table>
47+
<table>
48+
<tr>
49+
<td>User:</td>
50+
<td><input type='text' name='j_username' value=''></td>
51+
</tr>
52+
<tr>
53+
<td>Password:</td>
54+
<td><input type='password' name='j_password' /></td>
55+
</tr>
56+
<tr>
57+
<td><input name="submit" type="submit" value="submit" /></td>
58+
</tr>
59+
</table>
6260

63-
</form>
61+
</form>
6462
<br> Current Locale : ${pageContext.response.locale}
6563
<br>
6664
<a href="<c:url value="/user/registration" />">Sign Up</a>
67-
6865
</body>
66+
6967
</html>

‎spring-security-login-error-handling/src/main/webapp/WEB-INF/view/logout.jsp‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
2-
<%@ taglib prefix="sec"
3-
uri="http://www.springframework.org/security/tags"%>
2+
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
43
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
54

65
<html>
6+
77
<head>
88
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
99
<c:if test="${not empty SPRING_SECURITY_LAST_EXCEPTION}">
@@ -19,8 +19,10 @@
1919
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
2020
<title>Logged Out</title>
2121
</head>
22+
2223
<body>
23-
24+
2425
<a href="login.html">Login</a>
2526
</body>
27+
2628
</html>

‎spring-security-login-error-handling/src/main/webapp/WEB-INF/view/registration.jsp‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,29 @@
1111
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
1212
<title>Registration</title>
1313
</head>
14+
1415
<body>
1516
<H1>This is the registration page</H1>
16-
<form:form modelAttribute="user" method="POST" enctype="utf8" role="form" >
17+
<form:form modelAttribute="user" method="POST" enctype="utf8" role="form">
1718
<br>
1819
<tr>
1920
<td><label>First Name:</label></td>
20-
<td><form:input path="firstName" value =""/></td>
21+
<td><form:input path="firstName" value="" /></td>
2122
<form:errors path="firstName" cssClass="alert alert-error" element="div" />
2223
</tr>
2324
<tr>
2425
<td><label>Last Name:</label></td>
25-
<td><form:input path="lastName" value =""/></td>
26+
<td><form:input path="lastName" value="" /></td>
2627
<form:errors path="lastName" cssClass="alert alert-error" element="div" />
2728
</tr>
2829
<tr>
2930
<td><label>Username (your e-mail address):</label></td>
30-
<td><form:input path="username" value=""/></td>
31+
<td><form:input path="username" value="" /></td>
3132
<form:errors path="username" cssClass="alert alert-error" element="div" />
3233
</tr>
3334
<tr>
3435
<td><label>Password:</label></td>
35-
<td><form:input path="password" value="" type="password"/></td>
36+
<td><form:input path="password" value="" type="password" /></td>
3637
<form:errors path="password" cssClass="alert alert-error" element="div" />
3738
</tr>
3839
<input type="hidden" name="role" value="1" />
@@ -41,4 +42,5 @@
4142
<br>
4243
<a href="<c:url value="login.html" />">Back to Login</a>
4344
</body>
45+
4446
</html>
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
2-
<%@ taglib prefix="sec"
3-
uri="http://www.springframework.org/security/tags"%>
2+
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
43
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
54
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
65
<fmt:setBundle basename="messages" />
76
<%@ page session="true"%>
87

98
<html>
9+
1010
<head>
1111
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
1212
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
1313
<title>Registration Success</title>
1414
</head>
15-
<body>
1615

17-
<h1> <spring:message code="message.regSucc"></spring:message> </h1>
18-
<a href="<c:url value="login.html" />"><spring:message code="label.login"></spring:message></a>
16+
<body>
17+
<h1>
18+
<spring:message code="message.regSucc"></spring:message>
19+
</h1>
20+
<a href="<c:url value="login.html" />"><spring:message code="label.login"></spring:message></a>
1921
</body>
22+
2023
</html>

0 commit comments

Comments
 (0)