How can I receive an object from a form in an action, in order to avoid the getter and setter to receive field to field?
Example in Spring MVC
@RequestMapping(value = "/registro", method = { RequestMethod.POST })
public String crearUsuario(@ModelAttribute Usuario user,HttpServletRequest req) {
ModelMap model = new ModelMap();
registrarUsuario.crearUsuario(user);
req.getSession().setAttribute("idUsuario",user.getIdUsuario());
req.getSession().setAttribute("usuario",user.getNomUsuario());
return "redirect:/home";
}
In this case I am receiving a user object, as would be its equivalent in an action of struts2? Thank you very much.