J
javaguy44
Hi all,
I was wondering if someone might be able to answer a best practices
question for me.
Let's say I have an action class, and my ActionForward method is like:
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
DynaValidatorForm dvf = (DynaValidatorForm) form;
Customer cust = new Customer();
cust.setCustName("John Doe");
cust.setCustID("23");
At this point, how I would I want to pass my Customer bean to my jsp?
I am still new to struts, and thanks to some help I can now pass my
bean using the bean form property declared in Struts-Config or via a
request attribute. So my question is best practices wise, should I
post to the jsp using request.setAttribute like this:
request.setAttribute("RESULT", cust);
Or should I declare the bean in struts-config.xml and post like this:
dvf.set("customer", cust);
Thanks,
Javaguy
I was wondering if someone might be able to answer a best practices
question for me.
Let's say I have an action class, and my ActionForward method is like:
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
DynaValidatorForm dvf = (DynaValidatorForm) form;
Customer cust = new Customer();
cust.setCustName("John Doe");
cust.setCustID("23");
At this point, how I would I want to pass my Customer bean to my jsp?
I am still new to struts, and thanks to some help I can now pass my
bean using the bean form property declared in Struts-Config or via a
request attribute. So my question is best practices wise, should I
post to the jsp using request.setAttribute like this:
request.setAttribute("RESULT", cust);
Or should I declare the bean in struts-config.xml and post like this:
dvf.set("customer", cust);
Thanks,
Javaguy