Está en la página 1de 14

PLATAFORMA WEB

LENGUAJE JSP
ORIENTACIONES

• Debe tener instalado el Netbeans


con el Servidor Web GlasFish o
Tomcat
• Se sugiere que realiza los
ejercicios siguiendo las
indicaciones del Docente en
Línea, en Tutoría
CONTENIDOS TEMÁTICOS

• CONCEPTOS DE JSP

• EJERCICIOS PRACTICOS DE JSP


EJERCICIO1

Realizar un programa Web en


donde se ingresa la edad de
una persona y deba mostrar si
es MAYOR de Edad o Menor
de Edad, con su respectiva
imagen
PANTALLA DE INGRESO DE DATOS

MAYOR DE EDAD
MENOR DE
EDAD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=windows-1252"%>
<%
String xnom;
xnom=request.getParameter("txtnombre");
int xedad,num=0 ;
if(request.getParameter("OK") != null)
{xedad = Integer.parseInt(request.getParameter("txtedad"));
if (xedad>=0&&xedad<18)
num=2;
else if(xedad>=18&&xedad<=120)
num=3;
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-
1252"/>
<title>prueba1</title>
</head>
<body>

<form name="form1" action="prueba1.jsp" method="post">


<table border=1>
<tr><th colspan=2>DATOS PERSONALES</th></tr>
<tr>
<td>
INGRESA TU NOMBRE
</td>
<td>
<input type=text name=txtnombre></input>
</td>
</tr>
<tr>
<td> INGRESA TU EDAD
</td>
<td>
<input type=text name=txtedad></input>
</td
</tr>
<tr>
<td colspan=2>
<% out.println("<img src=imagenes/imagen0"+num+".jpg></img>");%>
</td>
</tr>
<tr>
<td>
<input type=submit name="OK" value='enviar'></input>
</td>
<td>
<input type=reset name="cancelar" value='nuevo'></input>
</td> </tr>
</table>
</form>
</body>
</html>
CONCLUSIONES Y/O ACTIVIDADES DE
INVESTIGACIÓN SUGERIDAS

Las Paginas Web JSP permiten


interaractuar con el Lenguaje HTML
GRACIAS

También podría gustarte