struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anuj Agrawal <agrawala...@yahoo.com>
Subject RE: query parameters
Date Mon, 09 Dec 2002 15:25:38 GMT
Thanks for the response Laird.  That's exactly the way i understood it so
your response helped validate my understanding (and yes, that's precisely
why i'm trying to use Struts - to separate business logic from presentation
logic).  However, after (2) takes place, i would have arrived at the JSP
page displaying the particular database record.  So how can a user
"bookmark" the page to come back directly to this particular record?  I
guess if the URL had the servlet (+ query parameters), the user could
bookmark that.  But since there is a forward involved, wouldn't the URL
(with the servlet+query parameters) be lost?

What am i missing here? :(
Anuj.

> -----Original Message-----
> From: Nelson, Laird [mailto:Laird.Nelson@FMR.COM]
>
> Normally the flow in a Struts application is like this:
>
>   browser --(1)--> Action --(2)--> JSP
>
> (1) is where the browser's request is handled by the ActionServlet, and
> where the ActionServlet figures out what Action to invoke.  The Action is
> responsible for retrieving any data needed (or invoking model-layer
> components to produce the data for it).  (2) is where the Action puts this
> data in the request or somewhere else from which the JSP (which hasn't
> entered the picture yet) can retrieve it.  I've oversimplified the
> architecture above, but you should get the idea.
>
> This is much different from the other way of doing things, which,
> from your
> messages, it looks like you're familiar with, viz. where a single JSP page
> gets data as it is needed, printing it out as it encounters it.
> This way of
> doing things is usually not recommended by Those in the Know because it
> freely mixes business logic with view logic.
>
> So, to answer your question literally, your JSP never invokes your servlet
> to get the data from the database.  And you are correct that only the
> servlet (or a Struts Action, or something called by a Struts
> Action) should
> access the data in the database.
>
> Hope this helps, and that I haven't inadvertently patronized you.


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message