JavaDabbaDoo.org -Tu comunidad Java parlante Implementar MVC - Struts 1.2
Inicio | Cursos infosintesis.net liberados | Java EE | Registrar a un usuario en un sitio Web con Struts 1.2
Registrar a un usuario en un sitio Web con Struts 1.2
Paso 2: Operativa

Vista - registroForm.jsp - Añadir literales en la cabecera del formulario

Este es el código de la página registroForm.jsp después de añadirle el formulario

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>

<!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>Formulario Registro usuario Struts 1.2</title>
 <link rel="stylesheet" href="/proregusuariostruts/css2/estilos.css" type="text/css">
</head>
<body>
 <html:form action="registro">
  
<div style="left: 210px; top: 10px; font-size: 24px;
       font-weight: bold; position: absolute">

   <bean:message key="
literal.registroUsurario" />
 
 </div>
  <div style="left: 250px; top: 40px; font-size: 10px; position: absolute">
   *
<bean:message key="literal.camposRequeridos" />
 
 </div>
 </html:form>
</body>
</html>

En el fichero literales/ApplicationResource.properties añadimos los dos primeros literales de nuestro formulario

literal.registroUsurario=Registro de usuario
literal.camposRequeridos=Campos requeridos

errors.header=<UL>
errors.prefix=<LI>
errors.suffix=</LI>
errors.footer=</UL>
errors.invalid={0} is invalid.
errors.maxlength={0} can not be greater than {1} characters.
errors.minlength={0} can not be less than {1} characters.
errors.range={0} is not in the range {1} through {2}.
errors.required={0} is required.
errors.byte={0} must be an byte.
errors.date={0} is not a date.
errors.double={0} must be an double.
errors.float={0} must be an float.
errors.integer={0} must be an integer.
errors.long={0} must be an long.
errors.short={0} must be an short.
errors.creditcard={0} is not a valid credit card number.
errors.email={0} is an invalid e-mail address.
errors.cancel=Operation cancelled.
errors.detail={0}
errors.general=The process did not complete. Details should follow.
errors.token=Request could not be completed. Operation is not in sequence.
welcome.title=Struts Application
welcome.heading=Struts Applications in Netbeans!
welcome.message=It's easy to create Struts applications with NetBeans.

Página anterior
Ignasi Pérez Valls
fundador-director Infosintesis Solutions Group
asesor-formador independiente
ignasiperez[ARROBA]javadabbadoo[PUNTO]org
Junio 2009
JavaDabbaDoo.org
Tu comunidad Java parlante. Cursos abiertos, tutoriales y mucho mucho más ...