Ver Mensaje Individual
  #12 (permalink)  
Antiguo 17/11/2010, 16:55
fcojose2001
 
Fecha de Ingreso: marzo-2009
Ubicación: Salamanca, España
Mensajes: 141
Antigüedad: 15 años, 1 mes
Puntos: 4
Respuesta: Problema campo int J2ee

He reducido el codigo al maximo para simplificar el error, pero no se muy bien donde aplicar los cambios q me propones, te adjunto el codigo minimizado el cual presenta los mismos fallos:

JSP:

Código PHP:
<&#37;@taglib uri="/struts-tags" prefix="s" %>

<%@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>User Details</title>
    </
head>
    <
body>
        <
s:form action="UserAction" >
            <
s:textfield name="age" label="Age" />
            <
s:submit />
        </
s:form>
    </
body>
</
html
Action:

Código PHP:

package vaannila
;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;


public class 
UserAction extends ActionSupport implements ModelDriven {

    private 
User user = new User();

    public 
UserAction() {
    }

    public 
Object getModel() {
        return 
user;
    }

    public 
String execute() {
        return 
SUCCESS;
    }

    public 
User getUser() {
        return 
user;
    }

    public 
void setUser(User user) {
        
this.user user;
    }

JavaBean:
Código PHP:


package vaannila
;


public class 
User {


    private 
Integer age 0;
    
    
    public 
Integer getAge() {
        return 
age;
    }

    public 
void setAge(Integer age) {
        
this.age age;
    }


Resultados:

Código PHP:


<%@taglib uri="/struts-tags" prefix="s" %>

<%@
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>User Details</title>
    </
head>
    <
body>
        <
h2>User Details</h2>
        <
hr>
        
Age :<s:property value="age" /><br>
    </
body>
</
html