Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<%@ taglib prefix="spring" uri="" %>
<%@ taglib prefix="c" uri="" %>
<%@ taglib prefix="t" tagdir="/WEB-INF/tags" %>
<jsp:attribute name="header">
<div class=“col-md-6”>
<h2>Sign In ...</h2>
<form action="/" method="post">
<input id= "tbUsername" name="username" type="text">
<input id= "tbPassword" name="password" type="password">
<button type="submit">Login</button>
<%--<button onClick="doLogin()">Login</button>--%>
<%--<script type="text/javascript">--%>
<%--var doLogin = function() {--%>
<%--var loginData = new Object();--%>
<%--loginData.username = $('#tbUsername').val();--%>
<%--loginData.password = $('#tbPassword').val();--%>
<%--var _url = '/';--%>
<%--type: 'POST',--%>
<%--// headers: {--%>
<%--// 'Accept': 'application/json',--%>
<%--// 'Content-Type': 'application/json'--%>
<%--// },--%>
<%--url: _url,--%>
<%--data: JSON.stringify(loginData),--%>
<%--dataType: 'json',--%>
<%--success: function (data) {--%>
<%--console.log('login succeeded');--%>
<%--if(data == "True"){--%>
<%--window.location.href = '';--%>
<%--error: function (xhr, status, err) {--%>
<%--alert('login failed');--%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment