como criar uam seessão com jsp
JavaScript
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<%
try
{
Class.forName("com.mysql.jdbc.Driver");
//out.println("Driver encontrado!");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost/login","root","root");
//out.println("Conexão realizada com sucesso!")
if (request.getParameter("usuario") != null)
{
Statement st = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_READ_ONLY);
ResultSet rs = st.executeQuery("select * from login where usuario = '"+
request.getParameter("usuario")+"' and senha = '"+
request.getParameter("senha")+"'");
if (rs.next())
{
response.sendRedirect("itens_cadastra.jsp");
}
else
out.println("Acesso ao Sistema Negado!");
}
}
catch(ClassNotFoundException erroClass)
{
out.println("Classe Driver JDBC não foi localizado, erro = "+erroClass);
}
catch(SQLException erroSQL)
{
out.println("Erro de conexão com o Banco de dados, erro = "+erroSQL);
}
%>
<form id="form1" name="form1" method="post" action="">
<div align="center">
<p> </p>
<p> </p>
<p> </p>
<table width="196" border="1">
<tr>
<td colspan="2"><label>
<div align="center">ACESSO AO SISTEMA<br />
</div>
</label></td>
</tr>
<tr>
<td width="88">Usuário:</td>
<td width="92"><label>
<input name="usuario" type="text" id="usuario" size="10" />
</label></td>
</tr>
<tr>
<td>Senha:</td>
<td><input name="senha" type="password" id="senha" size="10" /></td>
</tr>
<tr>
<td><label>
<input type="reset" name="limpar" id="limpar" value="Limpar" />
</label></td>
<td><input type="submit" name="acesso" id="acesso" value="Acessar" /></td>
</tr>
</table>
</div>
</form>
</body>
</html>
Also in JavaScript:
- Title
- angular loop through array
- Category
- JavaScript
- Title
- fetch api react
- Category
- JavaScript
- Title
- dynsmic calss in react add
- Category
- JavaScript
- Title
- insert into specific array index that has a value existing on that index
- Category
- JavaScript
- Title
- document delete element
- Category
- JavaScript
- Title
- enter event in jquery
- Category
- JavaScript
- Title
- get value onChange from mat-select angular
- Category
- JavaScript
- Title
- how to debug javascript
- Category
- JavaScript
- Title
- ERROR in ./src/app/pages/auth/auth.module.ngfactory.js Module not found: Error: Can't resolve '@angular/material/core/index'
- Category
- JavaScript
- Title
- how to learn javascript
- Category
- JavaScript
- Title
- combine p5 with react
- Category
- JavaScript
- Title
- comment obtenir l'élément parent javascript
- Category
- JavaScript
- Title
- chart.js data from mysql vanila javscript
- Category
- JavaScript
- Title
- dropdown list value react fragment
- Category
- JavaScript
- Title
- get value javascript
- Category
- JavaScript
- Title
- comment out in javascript
- Category
- JavaScript
- Title
- how to update angular version
- Category
- JavaScript
- Title
- foreach w3schools javascript
- Category
- JavaScript
- Title
- ion-fab-button ionic angular
- Category
- JavaScript
- Title
- functional component react
- Category
- JavaScript
- Title
- events js 292 throw er Unhandled 'error' event ^ Error getaddrinfo ENOTFOUND x86_64-apple-darwin13.4.0 at GetAddrInfoReqWrap.onlookup [as oncomplete]
- Category
- JavaScript
- Title
- get element by class
- Category
- JavaScript
- Title
- get all data attributes jquery from multiple elements
- Category
- JavaScript
- Title
- how to add role in discord.js v12
- Category
- JavaScript
- Title
- how to call action from another module vuex
- Category
- JavaScript
- Title
- JavaScript banner
- Category
- JavaScript
- Title
- html get class property
- Category
- JavaScript
- Title
- Javascript - Track mouse position
- Category
- JavaScript
- Title
- if you run a script.js with the code, how do you access the value passed to "var" inside script.js ...
- Category
- JavaScript
- Title
- enzyme test method
- Category
- JavaScript
- Title
- get input value in angular 7
- Category
- JavaScript
- Title
- email validation regex
- Category
- JavaScript
- Title
- get value from textbox in vanilla javascript
- Category
- JavaScript
- Title
- how to send an alert in javascript
- Category
- JavaScript
- Title
- get url params angular
- Category
- JavaScript
- Title
- how to write img jsx
- Category
- JavaScript
- Title
- dockerfile for nodejs
- Category
- JavaScript
- Title
- error Unexpected end of JSON input while parsing near '...
- Category
- JavaScript
- Title
- chart.js label word wrap
- Category
- JavaScript
- Title
- how to add text to h2 with jquery
- Category
- JavaScript
- Title
- array find method javascript
- Category
- JavaScript
- Title
- accèder data-id javascript
- Category
- JavaScript
- Title
- how to verify timestamp format in javascript
- Category
- JavaScript
- Title
- beautify json python
- Category
- JavaScript
- Title
- adding cors parameters to extjs ajax
- Category
- JavaScript
- Title
- javascript check if string contains substring
- Category
- JavaScript
- Title
- how to add object to array javascript
- Category
- JavaScript
- Title
- how to run different node app on server different domains
- Category
- JavaScript
- Title
- ajax with progress bar
- Category
- JavaScript
- Title
- google maps react
- Category
- JavaScript
- Title
- get utc time javascript
- Category
- JavaScript
- Title
- express server replit
- Category
- JavaScript
- Title
- javascript ascii to hex
- Category
- JavaScript
- Title
- angular list contains property
- Category
- JavaScript
- Title
- ionic cordova icon notification
- Category
- JavaScript
- Title
- add firebase angular
- Category
- JavaScript
- Title
- empty array js
- Category
- JavaScript
- Title
- if statement in javascript
- Category
- JavaScript
- Title
- install vue js
- Category
- JavaScript
- Title
- how to update kali linux on virtualbox
- Category
- JavaScript
- Title
- ${ js
- Category
- JavaScript
- Title
- chrome extension dynamically add javascript
- Category
- JavaScript
- Title
- check multiple ifield if it's blank in jquery
- Category
- JavaScript
- Title
- function prototype javascript
- Category
- JavaScript
- Title
- inline javascript html
- Category
- JavaScript
- Title
- ajax laravel example
- Category
- JavaScript
- Title
- autocomplete typeahead ajax
- Category
- JavaScript
- Title
- how to sort array least to greatest javascript
- Category
- JavaScript
- Title
- compile angularjs template
- Category
- JavaScript
- Title
- get url of page in background script
- Category
- JavaScript
- Title
- bracket notation javascript
- Category
- JavaScript
- Title
- how to add border to a text in html with javascript
- Category
- JavaScript
- Title
- capitalize all letters jquery
- Category
- JavaScript
- Title
- columndefs in datatable not working while setting width jquery
- Category
- JavaScript
- Title
- curl post json object command
- Category
- JavaScript
- Title
- install node modules
- Category
- JavaScript
- Title
- how to convert array to uppercase in javascript
- Category
- JavaScript
- Title
- component navigation without changin the url react router
- Category
- JavaScript
- Title
- Array Helpers
- Category
- JavaScript
- Title
- if (req.url === "/script.js")
- Category
- JavaScript
- Title
- javascript canvas reset transform
- Category
- JavaScript
- Title
- how to make a dictionary javascript
- Category
- JavaScript
- Title
- eval in js
- Category
- JavaScript
- Title
- drupal 8 node has field
- Category
- JavaScript
- Title
- array push javascript example
- Category
- JavaScript
- Title
- get browser timezone javascript
- Category
- JavaScript
- Title
- change text of element js
- Category
- JavaScript
- Title
- call javascript function after page load complete
- Category
- JavaScript
- Title
- cache buster in angular application
- Category
- JavaScript
- Title
- javascript check string lenght
- Category
- JavaScript
- Title
- angular event emitter
- Category
- JavaScript
- Title
- dataset js
- Category
- JavaScript
- Title
- how to print console in javascript
- Category
- JavaScript
- Title
- how to split two digit number in javascript
- Category
- JavaScript
- Title
- for Loop continue
- Category
- JavaScript
- Title
- for loop inside a for loop javascript
- Category
- JavaScript
- Title
- empty array javascript
- Category
- JavaScript
- Title
- graal.js javascript array in java
- Category
- JavaScript
- Title
- Angularjs datetime
- Category
- JavaScript
- Title
- async fetch api call
- Category
- JavaScript