First, it's important to note that Actions are not servlets. The
ActionServlet dispatches control to an Action, but the Action itself is
not an Action. 

The Struts Action classes return an ActionForward object. This is
usually retreived from the ActionMappings but can also be created on the
fly. 

If the database query returned a single record, you can have the Action
select the "single" ActionForward. Or "multiple" or "empty" as the case
may be. The ActionServlet will then forward control to the indicated
Action. 

-- Ted Husted, Husted dot Com, Fairport NY US
-- Developing Java Web Applications with Struts
-- Tel: +1 585 737-3463
-- Web: http://husted.com/about/services


"Struts Newsgroup (@Basebeans.com)" wrote:
> 
> Subject: Want one Action servlet to forward to another Action servlet
> From: [EMAIL PROTECTED] (Joe Fischer)
>  ===
>         My idea is to have an Action servlet query a database to
> search on a name.  If multiple names come back, it will forward to a
> selection jsp that allows me to select the desired name and then go to
> a "details" Action servlet.  That works fine.  But, if the first
> servlet finds an exact name match, then it should by-pass the multiple
> selection page and go straight to the "display" details Action
> servlet.  This servlet needs to make addition queries on the database,
> set up some info beans (similar to entity EJBs) and call one of
> several jsps to display the results.  So, how do I effect a forward
> from the first servlet to the second? Setting up the forward string
> the way the jsp does it does not seem to work.
>         Thanks.
> ---
> Joe
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

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

Reply via email to