Programadores me ajudem, por favor

Quero fazer a consulta pela combobox e pelo txtnome, só consigo fazer pelo txtnome até o momento.
Obrigado pelo resposta.

[code]
<html>
<head>
<title> </title>
</head>

<body>

<h1 align=“center”>Consulta de Usuários</h1>

<form name=“Formulario” action=“Consulta_Por_Nome.jsp” method=“post”>

<table border=“1” align=“center”>
<tr>
<td>Pesquisar Por:</td>
<td><select name=“cmbprocurar” id=“cmbprocurar”>
<option value=“codigo”>Código</option>
<option value=“nome”>Nome</option>
<option value=“cpf”>CPF</option></td>
<td><input type=“text” name=“txtnome” size=“50”></td>
<td><input type=“submit” value=“Buscar” ></td>
</tr>

</table>

</form>

<%@ page language=“java” import=“java.sql.*” %>
<%

String driver= “com.mysql.jdbc.Driver” ;
String url = “jdbc:mysql://localhost:3306/Projeto” ;
String user = “root” ;
String pass = “root” ;

String vnome = request.getParameter(“txtnome”) ;
String procurar = request.getParameter(“cmbprocurar”);

String sql ;

if ( vnome == “” ) {

sql=“select * from usuarios”;

}else{

sql = “select * from Usuarios where '”+ procurar + “’ like '” + vnome + “’”;

}

Class.forName(driver);
Connection conexao = DriverManager.getConnection(url,user,pass);

Statement stm = conexao.createStatement();

ResultSet resultado = stm.executeQuery(sql) ;

out.print( “<table border=1>” ) ;

while ( resultado.next() ) {

out.print( “<tr>” ) ;

out.print( “<td>” ) ;
out.print( resultado.getString(“codigo”) ) ;
out.print( “</td>” ) ;

out.print( “<td>” ) ;
out.print( resultado.getString(“nome”) ) ;
out.print( “</td>” ) ;

out.print( “<td>” ) ;
out.print( resultado.getString(“email”) ) ;
out.print( “</td>” ) ;

out.print( “</tr>” ) ;

}

%>

</body>

</html>

não esquece de usar o code para exibir o seu código fonte.

Não sei se é a mesma coisa mas pelo menos em struts2 você faz um literator dentro da tabela e depois vai na cassa action de e manda chamar a classe de negócio dentro do método com as anotações.

Dica: Edite seu post e use a tag code para o pessoal começar a te ajudar.

:thumbup:

Valeu, acabei de Editar

.