R
Rydell
I'm using Struts 1.2, and I'm having difficulty creating a lookup page
that can be accessed from a series of other pages.
For example, given a typical employee tracking system, when entering a
new employee's information, I will be entering their name, phone, and
supervisor. Since the list of potential supervisors is very long, I
don't want to use a drop list, I want to redirect to a supervisor
lookup page. After searching for the correct supervisor, I want to
select the supervisor, and return back to the initial new employee
entry page.
Naturally, if I have entered in the new employee's name and phone
number, I expect that it will be there upon return from the supervisor
lookup page. As the user, I will miffed if that information is no
longer there. But that is exactly what happened the first time I wrote
the page.
I solved this the only way I knew how, and that is to share a single
(session-scoped) form between the new employee page, and the supervisor
lookup page. Works just fine. Except for the fact that I have
hopelessly coupled my supervisor lookup jsp to my new employee jsp.
Which is fine until I discover the 4 other pages that have the same
need for a supervisor lookup feature. Now I'm either copying the
lookup page and action classes, or I'm sharing one massive form between
many pages.
So as a struts rook, I am stumped. I'm sure someone else has had a
problem like this, but I can't find reference to one. Each time I try
to "genericize" the supervisor lookup page, I get stumped by the fact
that the lookup page jsp has references to the specific form class, and
a need to know what page called the lookup page, so I can properly
return to it.
Granted it is a lame solution, which is why I'm having the problem. So
perhaps there is an obvious way to make it work? Or perhaps my
approach to saving state in the calling page (the new employee page) by
using a shared form could use some rethinking.
All comments appreciated -
Rydell
that can be accessed from a series of other pages.
For example, given a typical employee tracking system, when entering a
new employee's information, I will be entering their name, phone, and
supervisor. Since the list of potential supervisors is very long, I
don't want to use a drop list, I want to redirect to a supervisor
lookup page. After searching for the correct supervisor, I want to
select the supervisor, and return back to the initial new employee
entry page.
Naturally, if I have entered in the new employee's name and phone
number, I expect that it will be there upon return from the supervisor
lookup page. As the user, I will miffed if that information is no
longer there. But that is exactly what happened the first time I wrote
the page.
I solved this the only way I knew how, and that is to share a single
(session-scoped) form between the new employee page, and the supervisor
lookup page. Works just fine. Except for the fact that I have
hopelessly coupled my supervisor lookup jsp to my new employee jsp.
Which is fine until I discover the 4 other pages that have the same
need for a supervisor lookup feature. Now I'm either copying the
lookup page and action classes, or I'm sharing one massive form between
many pages.
So as a struts rook, I am stumped. I'm sure someone else has had a
problem like this, but I can't find reference to one. Each time I try
to "genericize" the supervisor lookup page, I get stumped by the fact
that the lookup page jsp has references to the specific form class, and
a need to know what page called the lookup page, so I can properly
return to it.
Granted it is a lame solution, which is why I'm having the problem. So
perhaps there is an obvious way to make it work? Or perhaps my
approach to saving state in the calling page (the new employee page) by
using a shared form could use some rethinking.
All comments appreciated -
Rydell