> The ideal would be for me to be able to pass the existing request's bean
to
> the new request.  Is this possible?

Short of trying to serialize the object and encode it into the URLs on the
page, I don't know of a way of getting a request-scope object to survive
outside of the scope of the request (go figure!).

I think my first try would be to write a "container" bean that would hold
all search results (either in the application scope or the session scope).
Whenever someone wanted a new search, the search container would handle the
process of making a new SearchResults object and it would merely pass back
some identifier that you could use to get it later:

  <jsp:useBean id="searchmanager" scope="session"
class="mypackage.SearchManager"/>

  <ora:useProperty id="mysearchresults" name="searchmanager"
property="newsearch" arg="hot teenage lesbian sluts"
class="mypackage.SearchResults"/>
  <!-- useProperty is a tag that appears in O'Reilly's "Javaserver Pages".
It's for beans that can return other beans as properties. In this case, the
searchmanager.getNewsearch(String arg) method returns an object of type
mypackage.SearchResults. useProperty calls this method and assigns the
returned bean to "mysearchresults". You can probably download O'Reilly's
implementation of useProperty, or you can brew your own. -->

  <jsp:forward page="product_list.jsp?searchid=<%= mysearchresults.getId()
%>" \>

Then, in your product_list.jsp, you'd have something to recall the results
based on their ID.... something like:

  <jsp:useBean id="searchmanager" scope="session"
class="mypackage.SearchManager"/>

  <ora:useProperty id="mysearchresults" name="searchmanager"
property="existingsearch" arg="<%= request.getParameter(\"searchid\") %>"
class="mypackage.SearchResults"/>

Let me know if this helps,

- Joe

Reply via email to