In my opinion, Eric, this is a bad solution.  There are lots of reasons this
is bad.  Rather than go through them, I would suggest you just add the logic
in /search.do?query=42 at the point you get the failure form
/retrieve.do?id=42.

On 1/7/06, Eric Jain <[EMAIL PROTECTED]> wrote:
>
> If a request for
>
>    /retrieve.do?id=42
>
> fails (e.g. couldn't find item in database), I'd like to say
>
>    request.setStatus(HttpServletResponse.SC_NOT_FOUND);
>    request.setAttribute("warning", "Not your lucky day.");
>
> and forward (not redirect) the request to
>
>    /search.do?query=42
>
> Can this behavior be accomplishing with Struts? Currently I'm using
> request.getRequestDispatcher(...).forward(...) with a modified
> HttpServletRequest, but there must be a better way (TM)...
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

Reply via email to