Hello, this is my first topic here, and thanks for deciding to read it.
I'm currently working on a project using
Struts 1, and as a Struts newbie I'm having some trouble managing one of the pages that I'm working on. I've spent a lot of time trying to learn how struts works and how to use it effectively, but like I said, I'm still a newbie to it.
I have five
jsp's created, four of these jsp's are the four possible views for when a user is navigating a 4-tabbed menu on a certain part of the website. They all use the same form, but each jsp allows the user to enter and manage different information.
The fifth jsp is a new one I'm creating, which offers a sort of "quick search" functionality, that the user can use to stay on the same screen and "view", but load up a different set of data. I already have the search functionality created. My problem is that I want this new, quick search jsp to use the same form and the same action that the other jsp's are using, since they are all closely related. I just needed to add a few form parameters to the form, and a new step to the action, and I thought I was good to go. The new quicksearch jsp is a tile, when I use to show it at the top of the other views, represented by each of the other jsps. I did this because I didn't want to replicated the exact same code four times.
However, I am having a problem. Since I have two jsp's using the same form on the same page, I think that when a user submits the "quicksearch" form, the parameters are immediately reset by the second instance of the same form on that page, and none of the parameters are getting passed to the action. Or something to that effect, I have print statements inside the action class, and they are consistently printing "null" for all the form parameters entered into the search bars. I have checked the getter and setter methods and my tags, and everything looks correct.
Now I'm just wondering if it's possible to even do this, have two jsp's using the same form on the same page. If not, is it possible to move the <html:form "/..."></form> tags into a base file that sort of wraps all the other jsp's?
Any help is greatly appreciated, I've been agonizing over this for a few days now.
Thanks,
ZW
[ August 04, 2008: Message edited by: Zachary Wright ]