Aha. That sheds some light. Real quick...here is my situation. My Search page is an Action because I have to lookup certain values in the database and display them in a select box. I then need this Search screen to submit to my actual search which is in SearchResulsAction (which needs to search the database for exactly what the user wants). Should I be using just one Action (perhaps SearchAction) and *somehow* display the appropriate page (the form or the results) based upon some criteria? Does that make sense?
>From a user's point of view... 1. Click Search 2. Fill in Search Form 3. Click Search 4. View Result List 5. Click a link on the appropriate search results 6. View Detail of the record they want >From my point of view, I thought I would need: 1. (Click Search) An action for the search page called SearchAction, which queries the database and displays the results on search.jsp 2. (Fill in Search Form) this is just my search.jsp rendered 3. (Click Search) An action SearchResultsAction called SearchResultsAction, which queries the database and displays the result LIST on searchResults.jsp 4. (View Result List) this is just my searchResults.jsp rendered 5. (Click a link on the appropriate search results) An action to called SearchResultDetailAction, which queries the database and displays the results on searchResultDetail.jsp 6. (View Detail of the record they want) this is just my searchResultDetail.jsp rendered So should I be uing just 1 action class? What is the best approach? Matt -----Original Message----- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 21, 2004 12:41 PM To: Struts Users Mailing List Subject: RE: Struts, Search Page, Help!!! > From: Matthew J. Vincent [mailto:[EMAIL PROTECTED] > However, if I select a value, press submit, and there is an > error...the > selected value is not "saved" and pre-selected. Actually, none of the > values are saved. My SearchForm has the appropriate getters > and setters. > How do I accomplish this? HELP AGAIN! :) > Is my struts-config.xml file setup incorrectly? I was unsure of the > <forward name="failure" path="/search.do"/> line below. > > <action-mappings> > <action path="/search" > type="SearchAction" > scope="session"> > <forward name="success" path="/search.jsp"/> > <forward name="failure" path="/appError.jsp"/> > </action> How is this even working with no 'name' attribute for the <action>? I think that's why you're not seeing the values... search.do does not have a form bean associated with it. > <forward name="failure" path="/search.do"/> I think the purists will complain about "Action Chaining" but I have a couple places in my where I display a list of search results, and I have the same thing. It works, it's just something to avoid if you can. Actually in this case I'm not sure why you need two actions. If you just have a Search action, you should be able to detect whether you need to display the form, or display the results. Could be as simple as having a hidden field on the form, and if that's present, you know the form was submitted and you forward to searchResults.jsp. DispatchAction or LookupDispatchAction might be helpful. Instead of multiple Actions, you have multiple methods in one Action, and use a request parameter (with LDA) to decide which method to use. -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]