Add at web.xml register page and servlet, and update register.jsp

This commit is contained in:
Sofia Baltzi 2017-10-20 12:30:19 +00:00
parent 960de3475f
commit e84e5c5c3f
2 changed files with 29 additions and 14 deletions

View File

@ -51,6 +51,18 @@
<url-pattern>/forgotPassword</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>RegisterServlet</servlet-name>
<display-name>Register</display-name>
<servlet-class>eu.dnetlib.openaire.usermanagement.RegisterServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>RegisterServlet</servlet-name>
<url-pattern>/register</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>VerificationCodeServlet</servlet-name>
<display-name>Verify code</display-name>

View File

@ -57,7 +57,8 @@
<div class="uk-width-1-3@m uk-align-center">
<!-- REGISTER FORM -->
<div id="registerForm">
<form target="GWTBootstrap3_AbstractForm_RepositoryManager_1" role="form" class="m-t" id="register_form">
<form action="register" method="POST" target="GWTBootstrap3_AbstractForm_RepositoryManager_1" role="form" class="m-t" id="register_form">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div class="alert alert-success" aria-hidden="true" style="display: none;"></div>
<div class="alert alert-danger" aria-hidden="true" style="display: none;"></div>
<div class="form-group">
@ -66,6 +67,8 @@
<div class="form-group">
<span class="msg_last_name_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your last name.</span>
<input id="last_name" name="last_name" type="text" placeholder="Last name" class="form-control"></div>
<div class="form-group">
<input id="organization" name="organization" type="text" placeholder="Affiliation / Organization:" class="form-control"></div>
<div class="form-group">
<span class="msg_username_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your username.</span>
<input id="username" name="username" type="text" placeholder="Username" class="form-control"></div>
@ -76,22 +79,22 @@
<input id="email" name="email" type="text" placeholder="Email" class="form-control"></div>
<div class="form-group">
<input id="email_conf" name="email_conf" type="text" placeholder="Confirm email" class="form-control"></div>
<div class="form-group">
<span class="msg_password_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your password.</span>
<span class="msg_pass_conf_error uk-text-danger uk-text-small uk-float-left" style="display:none">These passwords don't match.</span>
<p><span class="msg_please_add uk-text-danger uk-text-small uk-float-left" style="display:none">Please add: &nbsp</span></p>
<span class="msg_lowercase_letter uk-text-danger uk-text-small uk-float-left" style="display:none">A lowercase letter. &nbsp</span>
<span class="msg_capital_letter uk-text-danger uk-text-small uk-float-left" style="display:none">A capital (uppercase) letter. &nbsp </span>
<span class="msg_number uk-text-danger uk-text-small uk-float-left" style="display:none">A number. &nbsp</span>
<span class="msg_lenght uk-text-danger uk-text-small uk-float-left" style="display:none">Minimum 6 characters. &nbsp</span>
<input id="password" name="password" type="password" placeholder="Password" class="form-control"></div>
<div class="form-group">
<input id="password_conf" name="password_conf" type="password" placeholder="Confirm password" class="form-control"></div>
<%--<div class="form-group">--%>
<%--<span class="msg_password_error uk-text-danger uk-text-small uk-float-left" style="display:none">Please enter your password.</span>--%>
<%--<span class="msg_pass_conf_error uk-text-danger uk-text-small uk-float-left" style="display:none">These passwords don't match.</span>--%>
<%--<p><span class="msg_please_add uk-text-danger uk-text-small uk-float-left" style="display:none">Please add: &nbsp</span></p>--%>
<%--<span class="msg_lowercase_letter uk-text-danger uk-text-small uk-float-left" style="display:none">A lowercase letter. &nbsp</span>--%>
<%--<span class="msg_capital_letter uk-text-danger uk-text-small uk-float-left" style="display:none">A capital (uppercase) letter. &nbsp </span>--%>
<%--<span class="msg_number uk-text-danger uk-text-small uk-float-left" style="display:none">A number. &nbsp</span>--%>
<%--<span class="msg_lenght uk-text-danger uk-text-small uk-float-left" style="display:none">Minimum 6 characters. &nbsp</span>--%>
<%--<input id="password" name="password" type="password" placeholder="Password" class="form-control"></div>--%>
<%--<div class="form-group">--%>
<%--<input id="password_conf" name="password_conf" type="password" placeholder="Confirm password" class="form-control"></div>--%>
<div class="uk-margin uk-grid-small uk-child-width-auto uk-grid uk-text-left uk-grid-stack" uk-grid="">
<div class="uk-width-1-1 uk-text-meta uk-text-danger uk-first-column">All fields are required</div>
<div class="uk-width-1-1 uk-grid-margin uk-first-column">RECAPTHA I AM NOT A ROBOT THING GOES HERE</div>
<div class="uk-width-1-1 uk-grid-margin uk-first-column">
<button type="button" class="uk-button uk-button-primary" onclick="validateForm();">Register</button>
<button type="submit" class="uk-button uk-button-primary" onclick="return validateForm();">Register</button>
</div>
</div>
</form>
@ -100,7 +103,7 @@
<script>
var myInput = document.getElementById("password");
var myEmailInput = document.getElementById("email");
//var myEmailInput = document.getElementById("email");
// When the user starts to type something inside the password field
myInput.onkeyup = function() {