Autopopulate form and struts-example

Discussion in 'Java' started by Andy, Apr 13, 2004.

  1. Andy

    Andy Guest

    Hi,
    Problem description:
    Issue with pre-populating a form before it is displayed.

    Background:
    The application flows from page 1 (displayUserForm) to page 2
    (detailUserForm). Page 1 contains a list of username information and
    after I select one username, displayUserForm will display detail user
    information that was selected.

    I follow a similar pattern as described in struts-example. I have an
    action class (populateAction) that sits between displayUserForm and
    detailUserForm. This action class sole purpose is to populate
    detailuserForm properties so that when I get to page 2, the form has
    been populated.

    This is a straight forward approach, but I can't get the
    detailUserForm on page 2 populated. Struts throws an error saying that
    it can't find detailUserForm bean instance that I created and
    processed inside populateAction class.

    Any tips, hints is greatly appreciated.

    TIA
    -Andy
     
    Andy, Apr 13, 2004
    #1
    1. Advertising

  2. Andy

    Martin Guest

    (Andy) wrote in message news:<>...
    > Hi,
    > Problem description:
    > Issue with pre-populating a form before it is displayed.
    >
    > Background:
    > The application flows from page 1 (displayUserForm) to page 2
    > (detailUserForm). Page 1 contains a list of username information and
    > after I select one username, displayUserForm will display detail user
    > information that was selected.
    >
    > I follow a similar pattern as described in struts-example. I have an
    > action class (populateAction) that sits between displayUserForm and
    > detailUserForm. This action class sole purpose is to populate
    > detailuserForm properties so that when I get to page 2, the form has
    > been populated.
    >
    > This is a straight forward approach, but I can't get the
    > detailUserForm on page 2 populated. Struts throws an error saying that
    > it can't find detailUserForm bean instance that I created and
    > processed inside populateAction class.
    >
    > Any tips, hints is greatly appreciated.
    >
    > TIA
    > -Andy



    Andy,

    what do you think: can anybody give a 'straight forward' answer to
    your question when you present no details at all? You should post
    relevant parts of your code. Probably the 'relevant' parts are those
    that you have modified if you started with a struts-example. You could
    have an error in either jsp, struts-config.xml, bean or whatever...

    Martin
     
    Martin, Apr 14, 2004
    #2
    1. Advertising

  3. Andy

    analogueboy Guest

    Have you put your form bean into the correct scope?

    If you want to access the same formBean across multiple requests, the bean
    should be placed in session scope. Just be aware that Struts code is not
    thread safe when it comes to accessing form beans in session scope, seeing
    as the Struts developers won't take care of the problem you'll hvae to do it
    yourself.


    "Andy" <> wrote in message
    news:...
    > Hi,
    > Problem description:
    > Issue with pre-populating a form before it is displayed.
    >
    > Background:
    > The application flows from page 1 (displayUserForm) to page 2
    > (detailUserForm). Page 1 contains a list of username information and
    > after I select one username, displayUserForm will display detail user
    > information that was selected.
    >
    > I follow a similar pattern as described in struts-example. I have an
    > action class (populateAction) that sits between displayUserForm and
    > detailUserForm. This action class sole purpose is to populate
    > detailuserForm properties so that when I get to page 2, the form has
    > been populated.
    >
    > This is a straight forward approach, but I can't get the
    > detailUserForm on page 2 populated. Struts throws an error saying that
    > it can't find detailUserForm bean instance that I created and
    > processed inside populateAction class.
    >
    > Any tips, hints is greatly appreciated.
    >
    > TIA
    > -Andy
     
    analogueboy, Apr 14, 2004
    #3
  4. Andy

    analogueboy Guest

    Dynamic AOP

    Is anyone using a dynamic AOP framework like dynaop(.dev.java.net)? I added
    it into my application by repacing some of the code in my factories which
    returned dynamic proxies rather than direct references. But I also use
    Hibernate in the same application and they have conflicted on the version of
    CGLIB. In a toss up between DynAOP v. Hibernate I'll choose hibernate every
    time, so now I need a new AOP library.

    Does anyone know of a similar library that works on DP's rather than
    classloader interception or multiple compliation phases?


    "Andy" <> wrote in message
    news:...
    > Hi,
    > Problem description:
    > Issue with pre-populating a form before it is displayed.
    >
    > Background:
    > The application flows from page 1 (displayUserForm) to page 2
    > (detailUserForm). Page 1 contains a list of username information and
    > after I select one username, displayUserForm will display detail user
    > information that was selected.
    >
    > I follow a similar pattern as described in struts-example. I have an
    > action class (populateAction) that sits between displayUserForm and
    > detailUserForm. This action class sole purpose is to populate
    > detailuserForm properties so that when I get to page 2, the form has
    > been populated.
    >
    > This is a straight forward approach, but I can't get the
    > detailUserForm on page 2 populated. Struts throws an error saying that
    > it can't find detailUserForm bean instance that I created and
    > processed inside populateAction class.
    >
    > Any tips, hints is greatly appreciated.
    >
    > TIA
    > -Andy
     
    analogueboy, Apr 14, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eric
    Replies:
    3
    Views:
    443
    Mike Moore [MSFT]
    Aug 26, 2003
  2. guy
    Replies:
    0
    Views:
    333
  3. Katie Wright
    Replies:
    8
    Views:
    4,298
    Andrea Desole
    Jan 7, 2005
  4. Dave
    Replies:
    2
    Views:
    117
  5. Darren

    autopopulate input fields

    Darren, Oct 20, 2007, in forum: Javascript
    Replies:
    0
    Views:
    131
    Darren
    Oct 20, 2007
Loading...

Share This Page