cleanup work for registrationg

This commit is contained in:
eugenp 2014-08-23 15:10:43 +03:00
parent b30114fc26
commit 039d3c0af3
9 changed files with 64 additions and 63 deletions

View File

@ -1,22 +1,19 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<html>
<sec:authorize ifAnyGranted ="ROLE_USER">
<spring:message code="message.unauth" ></spring:message>
<sec:authorize ifAnyGranted="ROLE_USER">
<spring:message code="message.unauth"></spring:message>
</sec:authorize>
<head>
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
</head>
<body>
<head></head>
<sec:authorize ifAnyGranted="ROLE_ADMIN">
<H1> Hello Admin</H1>
</sec:authorize>
<H1>Hello Admin</H1>
</sec:authorize>
<a href="<c:url value="/j_spring_security_logout" />">Logout</a>
<a href="<c:url value="/home.html" />">Home</a>
</body>

View File

@ -1,6 +1,7 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"%>
<html>
<head>
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
</head>
@ -10,16 +11,16 @@
<security:authorize access="hasRole('ROLE_USER')">
This text is only visible to a user
<br/>
<br />
</security:authorize>
<security:authorize access="hasRole('ROLE_ADMIN')">
This text is only visible to an admin
<br/>
<br />
</security:authorize>
<a href="<c:url value="/j_spring_security_logout" />">Logout</a>
<a href="<c:url value="/admin.html" />">Administrator Page</a>
</body>
</html>

View File

@ -1,14 +1,14 @@
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="true" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page session="true"%>
<html>
<head>
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
<title>Home</title>
<title>Home</title>
</head>
<body>
<h1>
Welcome back home!
</h1>
<body>
<h1>Welcome back home!</h1>
</body>
</html>

View File

@ -1,13 +1,12 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ page session="true" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@ page session="true"%>
<html>
<head>
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
</head>
<body>
<body>
<h1>This is the homepage for the user</h1>
<sec:authorize access="hasRole('ROLE_USER')">
@ -23,8 +22,6 @@
<a href="<c:url value="/j_spring_security_logout" />">Logout</a>
<a href="<c:url value="/home.html" />">Home</a>
<a href="<c:url value="/admin.html" />">Administrator Page</a>
</body>
</body>
</html>

View File

@ -3,12 +3,13 @@
<html>
<head>
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
<title>Home</title>
<title>Home</title>
</head>
<body>
<h1 class="alert alert-error">
<spring:message code="message.sessionExpired" ></spring:message>
</h1>
<body>
<h1 class="alert alert-error">
<spring:message code="message.sessionExpired"></spring:message>
</h1>
</body>
</html>

View File

@ -1,6 +1,5 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec"
uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<fmt:setBundle basename="messages" />
@ -9,6 +8,7 @@
<fmt:message key="message.password" var="noPass" />
<fmt:message key="message.username" var="noUser" />
<html>
<head>
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
<c:if test="${param.error != null}">
@ -29,7 +29,6 @@
document.f.j_username.focus();
return false;
}
if (document.f.j_password.value == "") {
alert("${noPass}");
document.f.j_password.focus();
@ -43,27 +42,26 @@
<h1>Login</h1>
<a href="?lang=en">English</a> |
<a href="?lang=es_ES">Spanish</a>
<form name='f' action="j_spring_security_check" method='POST'
onsubmit="return validate();">
<form name='f' action="j_spring_security_check" method='POST' onsubmit="return validate();">
<table>
<tr>
<td>User:</td>
<td><input type='text' name='j_username' value=''></td>
</tr>
<tr>
<td>Password:</td>
<td><input type='password' name='j_password' /></td>
</tr>
<tr>
<td><input name="submit" type="submit" value="submit" /></td>
</tr>
</table>
<table>
<tr>
<td>User:</td>
<td><input type='text' name='j_username' value=''></td>
</tr>
<tr>
<td>Password:</td>
<td><input type='password' name='j_password' /></td>
</tr>
<tr>
<td><input name="submit" type="submit" value="submit" /></td>
</tr>
</table>
</form>
</form>
<br> Current Locale : ${pageContext.response.locale}
<br>
<a href="<c:url value="/user/registration" />">Sign Up</a>
</body>
</html>

View File

@ -1,9 +1,9 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec"
uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<html>
<head>
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
<c:if test="${not empty SPRING_SECURITY_LAST_EXCEPTION}">
@ -19,8 +19,10 @@
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Logged Out</title>
</head>
<body>
<a href="login.html">Login</a>
</body>
</html>

View File

@ -11,28 +11,29 @@
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Registration</title>
</head>
<body>
<H1>This is the registration page</H1>
<form:form modelAttribute="user" method="POST" enctype="utf8" role="form" >
<form:form modelAttribute="user" method="POST" enctype="utf8" role="form">
<br>
<tr>
<td><label>First Name:</label></td>
<td><form:input path="firstName" value =""/></td>
<td><form:input path="firstName" value="" /></td>
<form:errors path="firstName" cssClass="alert alert-error" element="div" />
</tr>
<tr>
<td><label>Last Name:</label></td>
<td><form:input path="lastName" value =""/></td>
<td><form:input path="lastName" value="" /></td>
<form:errors path="lastName" cssClass="alert alert-error" element="div" />
</tr>
<tr>
<td><label>Username (your e-mail address):</label></td>
<td><form:input path="username" value=""/></td>
<td><form:input path="username" value="" /></td>
<form:errors path="username" cssClass="alert alert-error" element="div" />
</tr>
<tr>
<td><label>Password:</label></td>
<td><form:input path="password" value="" type="password"/></td>
<td><form:input path="password" value="" type="password" /></td>
<form:errors path="password" cssClass="alert alert-error" element="div" />
</tr>
<input type="hidden" name="role" value="1" />
@ -41,4 +42,5 @@
<br>
<a href="<c:url value="login.html" />">Back to Login</a>
</body>
</html>

View File

@ -1,20 +1,23 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec"
uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<fmt:setBundle basename="messages" />
<%@ page session="true"%>
<html>
<head>
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Registration Success</title>
</head>
<body>
<h1> <spring:message code="message.regSucc"></spring:message> </h1>
<a href="<c:url value="login.html" />"><spring:message code="label.login"></spring:message></a>
<body>
<h1>
<spring:message code="message.regSucc"></spring:message>
</h1>
<a href="<c:url value="login.html" />"><spring:message code="label.login"></spring:message></a>
</body>
</html>