Академический Документы
Профессиональный Документы
Культура Документы
INDEX.JSP
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Desarrollo de Aplicaciones Web</title>
</head>
<body>
</body> </html>
AUTENTICACION.JSP
<%@page import="java.sql.*"%>
<%@page import="database.*"%>
<%
try{
Nuevo.jsp
<%@page import="database.*"%>
<html>
<head>
<title>JSP Page</title>
</head>
<body>
if(contador==1){
out.print("<script>alert('el usuario se creo correctamente');</script>");
}
db.commit();
db.desconectar();
} catch (Exception e) {
e.printStackTrace();
}
}
%>
<h4>Nuevo Usuario</h4>
<form name="f1" action="nuevo.jsp" method="POST">
Cuenta
<input type="text" name="ti_cuenta" value="" /><br>
Nombre
<input type="text" name="ti_nombre" value="" /><br>
Apellidos
<input type="text" name="ti_apellidos" value="" /><br>
Usuario
<input type="text" name="ti_usuario" value="" /><br>
Password
<input type="text" name="ti_password" value="" /><br>
<input type="submit" value="crear" name="bt_crear" /><br>
</form>
</body>
</html>
Modificar.jsp
<%@page import="database.Dba"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Connection"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
if(contador>=1){
out.print("<script>alert('el usuario fue modificado correctamente');</script>");
}
db.commit();
db.desconectar();
} catch (Exception e) {
e.printStackTrace();
}
}
%>
<%-- FIN paso 3--%>
<%
//paso #2 si preciono el link para modificar
if( request.getParameter("p_editar")!=null ){
%>
<br>
<hr>
<form name="f1" action="modificar.jsp" method="POST">
<table border="0">
<tbody>
<tr>
<td>Cuenta</td>
<td><input type="text" name="ti_cuenta" value="<%=
request.getParameter("p_cuenta") %>" readonly="readonly" /> </td>
<td>Nombre</td>
<td><input type="text" name="ti_nombre" value="<%=
request.getParameter("p_nombres") %>" /></td>
</tr>
<tr>
<td>Apellidos</td>
<td><input type="text" name="ti_apellidos" value="<%=
request.getParameter("p_apellidos") %>" /></td>
<td>Usuario</td>
<td><input type="text" name="ti_usuario" value="<%=
request.getParameter("p_usuario") %>" /></td>
</tr>
<tr>
<td>Password</td>
<td><input type="text" name="ti_password" value="<%=
request.getParameter("p_password") %>" /></td>
<td></td>
<td></td>
</tr>
<tr>
<td> <input type="submit" value="modificar" name="bt_modificar" /> </td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</form>
<%
}
%>
</body>
</html>