You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Matthew J. Vincent" <vi...@cs.usm.maine.edu> on 2004/01/14 16:33:07 UTC
Error Page Flow
Hello all,
I have a url that gets invoked with the url
http://localhost/prototype/search.do . I have a SearchAction class that
uses EJBs to pull data from a database to populate a pick list in my search
JSP page. I use some simple JSTL code to populate the select box:
<c:forEach var="strainType" items="${strainTypes}" varStatus="status">
<option><c:out value="${strainType}" escapeXml="false"/></option>
</c:forEach>
I use the following Struts tag to create the <form> tag
<html:form action="SearchResults"
name="search"
type="SearchForm">
I have a SearchForm class that is a simple ActionForm. When I submit the
form, I invoke my SearchResultsAction class, however this is where I need
help. When an error occurs, how do I get back to my search.do page with my
select box (1) populated and (2) have the chosen option from the select box
selected? Should I be using the Struts tag for a select box? How do i
re-retrieve the values in the select box? Am I making sense?
In my stuts-config.xml file I have:
<action path = "/SearchResults"
type = "SearchResultsAction"
name = "SearchForm"
scope = "request"
validate = "true"
input = "/search.jsp">
<forward name="success" path="/search.do"/>
<forward name="failure" path="/search.jsp"/>
<forward name="error" path="/appError.jsp"/>
</action>
Currently on an error, I am brought back to my search form with the errors
displayed, but the select box is not populated.
Help!
Thanks!
Matt
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org