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:
<%@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>