Return-Path: Delivered-To: apmail-jakarta-struts-user-archive@apache.org Received: (qmail 99112 invoked from network); 9 Dec 2002 15:09:55 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 9 Dec 2002 15:09:55 -0000 Received: (qmail 4611 invoked by uid 97); 9 Dec 2002 15:10:02 -0000 Delivered-To: qmlist-jakarta-archive-struts-user@jakarta.apache.org Received: (qmail 4560 invoked by uid 97); 9 Dec 2002 15:10:01 -0000 Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 4530 invoked by uid 98); 9 Dec 2002 15:10:01 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Date: Mon, 09 Dec 2002 10:06:12 -0500 From: Anuj Agrawal Subject: RE: query parameters In-reply-to: To: Struts User Mailing List Reply-to: agrawalanuj@yahoo.com Message-id: MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT Importance: Normal X-Priority: 3 (Normal) X-MSMail-priority: Normal X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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 > > > >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: For additional commands, e-mail: