Basic architecture for a struts search page

R

Rydell

As a person new to struts, I am having difficulty trying to decide how
to do the following:

I have a main page whose basic functionality is to search. Imagine a
page where you have several fields that are search criterie. You enter
your criteria, press "Find" and you get a list of results based on the
supplied search criteria.

However, one of the search fields is username. I would like to have a
droplist of valid usernames, but there are far too many. So I need a
second search page to help the user select the appropriate username.
When the user finds the correct username on the second page, they
select it, and we return back to the original page, with the selected
username in the appropriate username search field.

But, upon returning to the original search page, I would really like to
have any values that were originally typed in the search fields right
where I left them. Only now, the username search field is filled out
as well.

I'm finding this to be harder than I want it to be. A struts form
seems well suited to a single page, but when I move to a second page, I
want to hang on to the values from the first page, so I can put them
back upon my return. Where do I persist these values? Do I use a
single form for both pages? Do I write it to the database? Do I tell
the user tough cookies, and type the fields again?

I can think of a number of ways to do this, but I don't like any of
them. Since this is fairly common, I know someone has run into this
before. Advice? Taunts? All are welcome.....

Rydell
 
W

Wendy Smoak

Rydell said:
I'm finding this to be harder than I want it to be. A struts form
seems well suited to a single page, but when I move to a second page, I
want to hang on to the values from the first page, so I can put them
back upon my return. Where do I persist these values? Do I use a
single form for both pages? Do I write it to the database? Do I tell
the user tough cookies, and type the fields again?

I can think of a number of ways to do this, but I don't like any of
them. Since this is fairly common, I know someone has run into this
before. Advice? Taunts? All are welcome.....

Why don't you tell us what you've thought of, so we don't waste our time
detailing a solution that you've already discarded?

Briefly, I use a single session-scoped form, and take care in the reset
method not to clear the form if I'm POSTing back from the resolution
(lookup) page.
 

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

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top