You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Jon.Ridgway" <Jo...@upco.co.uk> on 2001/07/03 10:41:46 UTC

RE: Question in struts

Hi Suhas,
 
Yes your approach seems fine. A form bean in struts is a bean that extends
ActionForm and is used in HTML forms to capture and validate user input.
This bean is then passed to an Action class for processing. The action class
can either store results in the form bean or a value object that is added to
the request or session.
 
Jon.
 
-----Original Message-----
From: suhas [mailto:suhas_k@techmas.hcltech.com] 
Sent: 03 July 2000 12:37
To: struts-user@jakarta.apache.org
Subject: Question in struts 
 
Hi ,
 I Was going through  "Forward into the Past! (or a brief history of
Struts)" link at http://husted.com/about/struts/overview.htm
<http://husted.com/about/struts/overview.htm> 
" In a database application, the business-logic beans might connect to and
query the database and return the result set back to the action's servlet
... to be stored in a form bean ... and then displayed by the JSP. Neither
the action's servlet nor the JSP need to know (or care) where the result set
comes from. "
I'm writing following code in my OrderAction class . Delegation class
actually returns me the value object . Then In Jsp page I was iterating over
that valueObject ( is that what u talking as a form bean ???)  which I
stored in the request scope ...  Can anyone tell me is this correct way or
I'm missing something in this ??????
OrderView view[] = null ;
 try {
  OrderBusinessDelegation delegation = new OrderBusinessDelegation();
  view =  delegation.viewOrders(orderStatus);
 }catch(Exception  e) {
 }
 if( view != null) {
  request.setAttribute("view" , view);
 }
Suhas