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>
Source

Also in JavaScript: