RE: Multipage JDBC result
You didn't specify whether you want to do client-side or server-side paging. Assuming you want to pull the whole resultset in one shot, but have a paged presentation, check out the Struts Layout taglibs. They have a very handy pager widget that uses javascript and tags. If you want to do server side, this is really more of a database issue than a struts issue, and a lot will depend on what database you are using. The downside is you have to do a round-trip to the server for the next page. Search on Google for Scrollable resultsets. Almost all JDBC drivers support them. Another method is to specify a LIMIT offset in your query to specify the number of rows you want returned and where in the resultset you want to return from. Exact syntax is database-specific. David -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 1:27 PM To: Struts Users Mailing List Subject: Re: Multipage JDBC result It seems that it pulled the whole JDBC resultset into the memory at one time(correct me if I am wrong at this point) since my data sets will be very huge, I don't think it is a good idea to pull down all the data to the session for paging. Any better solution /examples? very appreciated!! Julie Andrew Kuzmin [EMAIL PROTECTED] 09/16/03 09:12 AM Please respond to Struts Users Mailing List To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject:Re: Multipage JDBC result Hi, see this link http://jakarta.apache.org/struts/faqs/newbie.html#pager -- Andrew Kuzmin http://www.java201.com - Original Message - From: Jonathan Hawkins [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, September 16, 2003 3:39 PM Subject: Multipage JDBC result Howdy, Any tips as to where I can find code examples of how to break down a large JDBC result into say 25 rows per page? Jon Hawkins - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = This transmittal and any attachments may contain confidential, privileged or sensitive information and is solely for the use of the intended recipient. If you are not intended recipient, you are hereby notified that you have received this transmittal and any such attachments in error and any review, dissemination, distribution or copying thereof is strictly prohibited. If you have received this transmittal and any attachments in error please notify the sender and immediately destroy the message and all its attachments. Any opinions herein expressed may be those of the author and not necessarily of Mizuho Corporate Bank, Ltd (the Bank). The Bank accepts no responsibility for the accuracy or completeness of any information herein contained. = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Layout problem: NPE with layout:checkboxes???
Hi all, Im experimenting with Struts Layout and having a problem with the layout:checkboxes tag. The jsp Im replacing uses the multibox tag backed by a DynaActionForm with a String[] property and works fine. But with Struts Layout, the layout:checkboxes grabs the collection properly out of the request and populates the form with checkboxes, but I get an NPE on form submit. Ive wracked my brains and cant diagnose the problem. Any hints appreciated! Heres the form: layout:form action=/newteamsave.do?method=newteamsave focus=teamname key=newteam.title styleClass=FORM Snip layout:checkboxes key=prompt.selectcats property=cats layout:options collection=categories property=categoryname/ /layout:checkboxes layout:formActions layout:submit property=submit value=Submit/ layout:reset/ /layout:formActions /layout:form And heres the NPE. Ive tried my own form class with an ArrayList() property insteadstill get the same exception. java.lang.NullPointerException at org.apache.commons.beanutils.PropertyUtils.setIndexedProperty(PropertyUt ils.java:1458) at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:928) at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:729) --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.502 / Virus Database: 300 - Release Date: 7/18/2003
Possible to dynamically set value of an html:select element?
Pardon the newbie-ness but Ive searched the archives extensively and havent turned up anything on this. Any hints would be much appreciated. Id like to know whether there is any way to dynamically set the property attribute within an html:select element. The page Im working on iterates through a collection of User beans, each of which has its own collection of Role beans. Each user is displayed on a row with a dropdown that is populated with that users collection of roles. The user needs to select a single Role for each user displayed, and Id like to get the form returned as a HashMap with the username as the key and the rolename as the value. The relevant snippet is below: logic:iterate id=user name=userlist bean:write name=user property=username/ html:select property=rolemap(username) html:optionsCollection name=user property=roles value=rolename/ /html:select /logic:iterate My problem, of course, is that since property=rolemap(username) isnt dynamic, the key gets stored verbosely as username, which overwrites the value on each iteration, so the map always gets returned with a single value. My guess is theres a straightforward way to do this, but Ill be darned if I can find it. Id very much appreciate it if someone could point me in the right direction. Thanks, David Benoff --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.502 / Virus Database: 300 - Release Date: 7/18/2003
RE: Possible to dynamically set value of an html:select element?
Thanks balaji, I'll try that:) David -Original Message- From: R Balaji [mailto:[EMAIL PROTECTED] Sent: Sunday, July 27, 2003 3:13 AM To: Struts Users Mailing List Subject: Re: Possible to dynamically set value of an html:select element? Have you ever tried with heml-el:select, where you can pass such expresions . balaji David Benoff wrote: Pardon the newbie-ness but Ive searched the archives extensively and havent turned up anything on this. Any hints would be much appreciated. Id like to know whether there is any way to dynamically set the property attribute within an html:select element. The page Im working on iterates through a collection of User beans, each of which has its own collection of Role beans. Each user is displayed on a row with a dropdown that is populated with that users collection of roles. The user needs to select a single Role for each user displayed, and Id like to get the form returned as a HashMap with the username as the key and the rolename as the value. The relevant snippet is below: logic:iterate id=user name=userlist bean:write name=user property=username/ html:select property=rolemap(username) html:optionsCollection name=user property=roles value=rolename/ /html:select /logic:iterate My problem, of course, is that since property=rolemap(username) isnt dynamic, the key gets stored verbosely as username, which overwrites the value on each iteration, so the map always gets returned with a single value. My guess is theres a straightforward way to do this, but Ill be darned if I can find it. Id very much appreciate it if someone could point me in the right direction. Thanks, David Benoff --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.502 / Virus Database: 300 - Release Date: 7/18/2003 --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.502 / Virus Database: 300 - Release Date: 7/18/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.502 / Virus Database: 300 - Release Date: 7/18/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]