Autopopulate form and struts-example

A

Andy

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
 
M

Martin

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
 
A

analogueboy

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.
 
A

analogueboy

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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top