Hi everyone,

I have a situation in which I would like to do the following:

1) I'm at a jsp page, let's call it "a.jsp".  It has one link that looks
like:
        
        <html:link page="/mainMenu.do?action=customer"> Customer
</html:link>

2) My mainMenu action in struts-config.xml looks like (name="..." is
left out on purpose):

  <action       path="/mainMenu"
                type="net.alfa.china.menus.MainMenuAction">
        <forward name="customer" path="/customer_main.jsp"/>
        <forward name="order" path="/order_main.jsp"/>
        <forward name="purchase" path="/purchase_main.jsp" />
        <forward name="inventory" path="/inventory_main.jsp" />
  </action>


3) Inside of perform in MainMenuAction, I would like to create my own
form bean of type ActionForm.  I am then going to load a customer from
my db (through a business logic bean), and set the fields in the
ActionForm.  I'm hoping to use that ActionForm to populate a form in
"customer_main.jsp" when we finally forward there.  That form is defined
using <html:form>.

I'm basically wondering what the mechanism is that struts uses to
populate a <html:form> with an ActionForm.  I'm coming from a page
without a form (a.jsp), would like to be able to create an ActionForm in
perform(), stick it in the request, and when I forward to my
customer_main.jsp, have struts populate the form there with what's in
the ActionForm.

I've tried quite a few different approaches and can't seem to make it
work.  Is this possible?  Any suggestions?

Thanks,

Tony Li

Reply via email to