Processing a large number of records
I am building a feature into my app that will allow users to generate printable results from data. The number of results is in the thousands and the problem I'm having is that the http request timeouts before the data processing is complete. The method I've adopted is to take a arrayList of data objects and then iterate through the list and generate an arrayList of result objects which I can either pass to a jsp page for rendering or convert to a pdf document. The problem I have is that when the list of data objects is small (a couple of hundred) it works fine, but when the list is large (3 or 4 thousand) the data processing isn't complete when the request times out. Is there a way to flush the response after each loop and keep the connection alive. Any suggestions would be greatly appreciated. Zoran - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Data Access Optmizing
> Had you thought about using a single SQL statement to populate > everything? In other words, if your cycle is: > - Get a bunch of user response objects > - For each user response object, get its user feedback objects > This is something which is very easy to do with two SQL statements, > rather than one plus one per user response object. Since there's > overhead in each SQL Statement you issue, a good place to start might be > in doing this. It's actually a little more complex than that. What happens is that I perform a number of calculations, which use variables stored in the database and depending on the result more information is retrieved from the database and added to the response. It's not a standard 1-n or n-n relationship, but more extracting data on the fly. One option is to store the calculation variables in a hash table stored in application scope and only change them when they have been updated. Will using something like iBatis or even Hibernate improve the situation? Zoran - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Data Access Optmizing
I have a small struts web app which stores user entered information in a DB and then it performs some calculations on the data and spits out a results page. The app is working fine but I'm seeing some performance issues with regards to data access. I'm using simple data access objects which connect to a container managed JNDI pool. I can retrieve large amounts of data quite quickly but when I use nested connection performance really suffers. By nested calls I mean that say I retrieve a Collection of a couple of thousand user response objects (which are retrieved quite quickly) and then I process the responses by iterating through them to produce a Collection of user feedback objects. During each cycle I make a number of database calls to get information related to processing the individual user response. This is where things get really slw. What I'm after is some pointers on what the best practise in dealing with this situation is. How do others get around this issue? My thinking is that it's not the data access method (simple DAO's) but more the fact that I'm opening and closing so many connections during the processing phase. Any help would be really appreciated. Zoran - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
MS SQL Server Dates
I'm using an existing MS SQL Server for a small web app. I'm doing a query based on daily activity. I build my query using a string buffer which looks like "SELECT * FROM artciles WHERE " + date1SQL + "<=submitted and date_entered < " + date2SQL Where date1SQL and date2SQL are strings formatted "MMddHHmmss" My question is, is this the best way to do it. Submitted is a smalldatetime field and both date1 and date2 are GregorianCalender objects which I canvert as required. Any help would be appreciated. Zoran - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts with JRun4
We have a number of apps with struts 1.1, JSTL and JNDI. Nothing overly different to deploying on other app servers. Zoran > Hi, > > Has anybody successfully deployed struts with JRun4? Are there any > documents? Let me know. > > Regards, > Samanth > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Pagination with JSTL
I'm looking at implementing JSTL in my next struts project and I was wondering if any body had an example of pagination using JSTL and JDBC. At present I use James Klicman's pager taglib (which I like) but I can see a number of advantages moving to using JSTL and more importantly using the capabilities of JDBC2 to retrieve the exact dataset for display. Zoran - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Accessing Application properties from business classes.
Hi guys, I know I've asked this before but I'm after some clarity. I have a web application which gets deployed on a number of different systems and each one has different settings with respect to file locations and email server settings. I'd like to set the mail server and directory settings in the application.properties file (one central location, automatically picked up by the app, etc). I need a way to easily access the file from business classes. At the moment I am using a couple of different workarounds: getting the settings in the action file and then passing the appropriate values to business methods, or passing the request object to the business methods, neither of which seem very efficient. I'd like to know if there is a way of retrieving the values in a simpler fashion, using the application object for example. As always any input always appreciated. Zoran - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Accessing ApplicationResources.properties
I have what is hopefully a simple question. I have a set a number of file system specific variables in my ApplicationResources.properties file to make it easier to deploy the application on different platforms. I can access Message Resources properties from Action classes using: MessageResources messages = getResources(request); String message = messages.getMessage("the.chosen.message"); Outside an action class I'm having trouble instantiating the MessageResources. I can see that I need to use: MessageResources messages = MessageResources (x, y); But I don't know what arguments to pass as x and y Could somebody please email me a way to get this done in my helper classes. Thanks Zoran - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CMP EJB2.0 Struts Example
I'm OK on the struts side of things, I'm really looking for some examples of the framework in use with CMP - something which implements EJB 2.0 Persistence and in particular Container Managed Persistence. The petstore examples don't use CMP2.0 as the persistence models. Zoran > http://www.trifork.com/web/articles.html > http://www.ibatis.com/jpetstore/jpetstore. > > Both above are PetStore using Struts with source code. > .V > > Zoran Avtarovski wrote: >> I'm about to start work on a application which I'd like to use the struts >> framework with CMP2.0 EJBs. >> >> Our current structure for applications follows a pretty standard approach: >> >> /action/action-classes >> /business/business-classes >> /DAO/data-access-classes >> /entity/entity-classes >> >> >> I'd like to see what the ideal/preferred structure for an application using >> session beans for the business logic and CMP entity beans for data access. >> >> I'm hoping there's a pet store (or similar) example that I could have a look >> at to guide me. >> >> Zoran > > > > - > 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]
CMP EJB2.0 Struts Example
I'm about to start work on a application which I'd like to use the struts framework with CMP2.0 EJBs. Our current structure for applications follows a pretty standard approach: /action/action-classes /business/business-classes /DAO/data-access-classes /entity/entity-classes I'd like to see what the ideal/preferred structure for an application using session beans for the business logic and CMP entity beans for data access. I'm hoping there's a pet store (or similar) example that I could have a look at to guide me. Zoran - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ultradev + Struts TagLib
Do you mean UltraDev 4 ot Dreamweaver MX? There is an extension to UD 4 at the jakarta site and DW MX allows you to import the tld files so they can be used. I use DW MX for template construction and I find it works without a hitch. Z. > Someone know how to work with Ultradev and Struts TagLib? > > Can Macromedia Ultradev display TagLib how Web Component? > > __ > Eduardo Fabrício Elias > CIEE-RS - Porto Alegre > [EMAIL PROTECTED] > ICQ#: 25223384 > Fone: 51 32847029 > __ > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [newbie] Connection Pooling
Why wouldn't you use a simple update statement on the revised, validated data, rather than keeping the connection open for long? Z. > Folks, > > quite new to Struts and it's way to JPS-Action-etc. chaining I'd like to > know the following. Is their a way to keep open a certain connection to > a database between two actions, e.g. I have a EditGetAction where I > prepopulate a form, then show the jsp and make the user work and finally > after validation write the (maybe) changed fields back into the database > ??? > > Hope, this is not a absolutely stupid question ... > > > - > 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]
Re: Collection manipulation and form validation
HI Anthony, I'm not sure if this considered bad practice but I validate my forms in the business logic code. This enables me to control more precisely the actions on a validation error. Typically, on a validation error I return the submitted bean as well as the error. This way site users don't lose their entered data. Zoran > Hi there folks, > > I am writing a webapp which has dynamically changing form fields on any > given page. They change both in number and display format etc etc I > therefore want to use some kind of collection of beans which my JSP can > iterate through to display the form fields in order and format according to > properties in the beans. > > My problem occurs when the form fields are edited, submitted and validated. > In the event of validation failure, the form is redisplayed with the > html:errors and the original values instead of the updated values because of > course the Collection used to render the page is now out of sync with the > values in the formBean itself. Are there existing patterns to update the > beans in a collection upon submission/validation? I am thinking I have to > overload the Validate method in my ValidatorForm to populate the Collection > from the form submissions? I have noticed that BeanUtils may help here > > Thanks for any help > Anthony > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Pager tag trouble
Apologies if this was sent twice, mail server issues Hi, I've got a struts application which displays lists of information from a database. I use a action class to retrieve and place the information into a Collection which I then return to a display jsp. Pretty standard stuff. In the jsp page I am using the iterate tag to display the collection. Everything works well, except that the pages were getting a little on the long side, so I though rather than writing pagination code from scratch I'd use James Klicman's pager tag which offered a quick and easy solution. I'm having problems getting the pager tag to work with my page. I can get the example to run without a hitch, but that uses a for-next loop with some code on the page. Has anybody gotten the pager tag to work with an iterate tag and if so can you please send me some sample code. Or, am I better off writing some code into my action classes which pass an offset value, and some display parameters with each request, which I then pass back to the page? Any help would be greatly appreciated. Zoran - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Pager tag troubles
Hi, I've got a struts application which displays lists of information from a database. I use a action class to retrieve and place the information into a Collection which I then return to a display jsp. Pretty standard stuff. In the jsp page I am using the iterate tag to display the collection. Everything works well, except that the pages were getting a little on the long side, so I though rather than writing pagination code from scratch I'd use James Klicman's pager tag which offered a quick and easy solution. I'm having problems getting the page to work with my page. I can get the example to run without a hitch, but that uses a for-next loop with some code on the page. Has anybody gotten the pager tag to work with an iterate tag and if so can you please send me some sample code. Or, am I better off writing some code into my action classes which pass an offset value, and some display parameters with each request? Any help would be greatly appreciated. Zoran - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]