Are you using struts html tags to write the rest of your form?

--- "Matthew J. Vincent" <[EMAIL PROTECTED]> wrote:
> I'm sorry I am so lost today!
> 
> Now...here is the problem I am having.
> 
> When a user goes to http://localhost:8888/search.do
> 
> From my understanding this will call my SearchAction class as specified in
> my struts-config.xml file:
> 
>    <form-beans>
>       <form-bean name="strainSearchForm"
>                  type="StrainSearchForm"/>
>    </form-beans>
> 
>    <action-mappings>
>       <action path="/search"
>               type="SearchAction"
>               scope="session">
>          <forward name="success" path="/search.jsp"/>
>          <forward name="failure" path="/appError.jsp"/>
>       </action>
> 
>       <action path = "/searchResults"
>               type = "SearchResultsAction"
>               name = "strainSearchForm"
>               validate = "true"
>               input = "/search.do">
>          <forward name="success" path="/searchResults.jsp"/>
>          <forward name="failure" path="/search.do"/>
>          <forward name="error" path="/appError.jsp"/>
>       </action>
>    </action-mappings>
> 
> and if all is well, forward to search.jsp to diplay my search screen (not my
> search results).
> 
> From the search screen, when the user clicks Search searchResults.do (not
> search.do) is invoked, strainSearchForm.validate() gets called and then my
> SearchResultsAction.execute() method.  If the strainSearchForm.validate()
> returns an error, the error is displayed on the screen, but the values that
> the user types are lost so they have to retype in everything.  How do I get
> the values to already be filled in?  If I put them in session scope, will I
> have to clear the values later (when they start a new search)?  Also, I
> would like to do the same thing if no results are returned in my
> SearchResultsAction class - how do I do this as well?  (On a side note, my
> strainSearchForm.reste() method is empty - should it be?) Is my config file
> wrong?  Am I not doing something correctly?
> 
> Again, should I just have 1 action class or is having multiple action
> classes like this ok?  What is the best practice or approach here?
> 
> Matt
> 


__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to