Boa Tarde Senhores,
Tenho o seguinte html
<html>
<head>
<style type="text/css">
@import url(styles.css);
</style>
</head>
<title>S.A.U- SERVIÇO DE APOIO AO Usuário</title>
<background="Red">
<body bgcolor="#FF0000">
<br>
<br>
<div id="header"> <img src="resources/cabecario.png" alt="" name="logo" width="996" height="150" id="logo" />
</div>
<br>
<div id="content_login" align="center>
<ul class="login">
<h2>Acesso ao Sistema</h2>
<form name="formLogin" + " method="get" action = "validacaoUsuarios">
<p><strong>Login </strong> <input type="text" name="txtlogin" ></p>
<p><strong> Senha </strong> <input type="password" name="txtSenha" ></p>
<p> <input type="submit" value="Logar"></p>
</center>
</ul>
</div>
</body>
</html>
Que chama o seguinte servlet - > validacaoUsuarios
package servlet;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import database.conexao;
import java.text.SimpleDateFormat;
import java.util.Date;
import funcionalidades.funcoes;
public class validacaoUsuarios extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException,ServletException{
response.setContentType("text/html");
String vUsuario = request.getParameter("txtlogin");
String vSenha = request.getParameter("txtSenha");
String vCondicao;
HttpSession session = request.getSession();
session.setAttribute("txtlogin",vUsuario);
session.setAttribute("txtSenha",vSenha);
vUsuario = vUsuario.toUpperCase();
vSenha = vSenha.toUpperCase();
vCondicao = "where nom_login = '" + vUsuario + "' and cod_senha = '"
+ vSenha+"'";
PrintWriter escreve = response.getWriter();
funcoes function = new funcoes();
/* cabeçario */
escreve.println(function.montaCabecario());
/* fim cabeçario */
conexao connect = new conexao();
/* Valida usuario */
escreve.println(function.validaUsuarios(vCondicao));
/* menu */
escreve.println(function.montaMenuSuperior(1, vUsuario, vSenha));
/* fim menu */
connect.desconecta();
SimpleDateFormat formatar = new SimpleDateFormat("dd/MM/yyyy");
Date data = new Date();
/*Criar dia principal*/
escreve.println("<div id="+"content_container"+">");
/*Menu Lateral*/
escreve.println(" <div id="+"sidebar"+">");
escreve.println(" <h2> Sistema </h2>");
escreve.println(" <div class="+"box"+">");
escreve.println(" <ul class="+"news"+">");
escreve.println(" <li style="+"margin-left:30px;"+"><strong>Data</strong></li>");
escreve.println(" <li style="+"margin-left:30px;"+">"+ formatar.format(data) +"</li>");
escreve.println(" </ul>");
escreve.println(" </div>");
escreve.println(" </div>");
/*Menu Lateral*/
/* Conteudo */
escreve.println("<div id="+"content"+">");
escreve.println("<center><h1>Sistema de Administração</h1></center>");
escreve.println("<p> Bem vindo a interface administrativa dos sistemas </p>");
escreve.println("<p><strong> * Comissionamento</strong></p>");
escreve.println("<p><strong> * Comissionamento Pós</strong></p>");
escreve.println("<p><strong> * Rebate</strong></p>");
escreve.println("<p><strong> * Contestação</strong></p>");
escreve.println("<p><strong> * Utilitários</strong></p>");
escreve.println("</div>");
/* Fim Conteudo */
/*Fim div principal*/
escreve.println(function.finalizaMenuPrincipal());
/* Rodape */
escreve.println(function.montaRodape());
/* fim rodape */
}
}
No caso quando carrega este servlet, ele mostra na barra de endereços o usuario e senha.
Nas outras classes, consegui resolver usando session.
Podem neste estou com duvidas de como fazer, alguem pode me ajudar ?
grato