Hello,
 
Up until today, my workflow has been to give the user a jsp form, user submits, 
to an action, where a form bean collects and data, validates it, sends it to an 
action and the cycle is complete. I get this flow and all is good.
 
Today, I have a unique problem. I actually have the need to go to the database, 
populate a bean, and then display the contents of that bean in a jsp page. 
(Basically backwards from what I have done in the past).
 
So here is what I tried to do, but it does not seem to function properly.
I created an action 
 <action path="/myaccount"
      type="com.ddi.dealer.action.admin.DisplayMyAccount"
      name="usersbean"
      scope="request"
      validate="false"
      input="/jsp/admin/mainAdmin.jsp">
      <forward name="Success" path="/jsp/admin/myAccount.jsp" />
    </action>

so when the user calls for myaccount.do,  it tries to create the usersbean. But 
of course there is no data, so hopefully, it just creates it and puts it into 
the request scope. Then it goes to the DisplayMyAccount action in which now, I 
create the usersbean and populate it with data from the database, then I put it 
into the request scope from the action like so: 
request.setAttribute("usersbean", usersbean);
 
Then I figure it forwards to my jsp page where I have fields like so:
      <html:text property="firstName" size="30" maxlength="30"/>
 
Is what I described the proper way to handle this? And should it work 
(currently, it is not populating the fields properly)
 
I could use some advice if someone has been through this scenario.
 
Thanks,
Scott
 
 

Reply via email to