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:06:12 GMT
Well, i understand what you are suggesting.  Let me re-state my question in
a different way.  How can i set it up so that when a user goes to
http://some.domain.name.here/simpleapp/view.jsp?id=5, it would automatically
load the form and display results from the database pertaining to record
with ID=5 (obviously the next and prev links would have the appropriate
query parameters).

I know (i think) how to do this directly in the JSP (using JSTL's
db-querying tags), but i thought that only the servlet should access the
database and obtain the record, so how would my JSP page invoke the servlet
to get the data from the database?  Am i over-complicating it? :(

Anuj.

> -----Original Message-----
> From: David Graham [mailto:dgraham1980@hotmail.com]
>
> You would have an id query parameter telling the page which record to
> display.  The previous/next links would need to point to the next id not
> just a general previous command.  You can cache the results in
> the session
> so you can find the next id in the list.
>
> >From: Anuj Agrawal <agrawalanuj@yahoo.com>
> >
> >In order to understand the correct flow of Struts, i'm trying to create a
> >simple form that has 2 fields and a "Next" and "Previous"
> button/link.  As
> >i
> >click the buttons/links, i want the form fields to be filled
> with data from
> >a database (1 record at a time).  This appears easy enough to do
> - i could
> >simply make the Next/Previous buttons/links point to a next.do or prev.do
> >servlet which would perform some Action (which in turn would use some
> >delegate (?) to access the database and populate the formbean) and then
> >redirect (forward) to the particular JSP (to auto-fill the
> fields).  (Jeez!
> >I hope i got the above right so far).
> >
> >HOWEVER, what i'd *like* to be able to do is each page should be
> >book-markable - i.e. the page should have a query string (perhaps
> >?id=primaryKeyinDatabase) so that the user can get to a particular record
> >directly.  It seems to me that by doing the redirect (forward) from the
> >servlet, i would not be able to achieve this?
> >
> >How can i do the above?  Or is this one of those cases where i
> *shouldn't*
> >be using Struts?


--
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