You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bhay Zone <bh...@yahoo.co.in> on 2006/09/11 22:12:07 UTC

Each tiles:insert invokes ServletFilter

Hi,
   
  I have a jsp page in which tiles:insert is called 10,000 times. I have 7 servlet filters defined in the application.  My problem is that for each tiles:insert the entire filter chain is also invoked. This degrades my page rendering. I replaced the tiles:insert with out.println - in this case, the filter chain was not getting called and page performance improved dramatically.
   
  I want a way to continue using filters and tiles, but avoid the filters being called for each tiles:insert.
   
  I have to find a solution to this. Any help is appreciated. 
   
  Thanks,
  Bhayzone

 				
---------------------------------
 Find out what India is talking about on  - Yahoo! Answers India 
 Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW

Re: Each tiles:insert invokes ServletFilter

Posted by Richard Yee <ry...@cruzio.com>.
Bhay,
Before you spend much time on the current design, I suggest that you try 
sending a page with dummy data to a browser that has 1000 rows and 10 
columns. You might be able to demonstrate the lack of usability to the 
customer and also uncover browser rendering issues with the design.

-Richard



Bhay Zone wrote:
> I tried to simplify the problem when I posted my question. Here is the actual scenario.
>    
>   Every piece of data displayed on my page is displayed using a tiles - thats for uniformity across the application. There are around 1000 rows being dispalyed, and each row has 10 columns (thus the figure 10k). 
>
> The business users want to see all the rows on one page. I really have to go with the tiles / servlet filters thing. That's how the application was written. It is beyond me to make those decisions. I have to find a way to optimize the current page. Basically I need to find a way to stop the filters being called for a tiles:insert. Once that happens, I should be on my way. 
>
> David Friedman <hu...@ix.netcom.com> wrote:
>   Have you considered looking at a template engine such as Velocity or
> Freemarker? I'm sure it would have greater efficiency than reinvoking the
> servlet and filter chains 10k times. And yes, I will hold back my urge to
> ask why you are putting 10k items on any page in the first place.
>
> Regards,
> David
>
> -----Original Message-----
> From: Bhay Zone [mailto:bhayzone@yahoo.co.in]
> Sent: Monday, September 11, 2006 4:12 PM
> To: user@struts.apache.org
> Subject: Each tiles:insert invokes ServletFilter
>
>
> Hi,
>
> I have a jsp page in which tiles:insert is called 10,000 times. I have 7
> servlet filters defined in the application. My problem is that for each
> tiles:insert the entire filter chain is also invoked. This degrades my page
> rendering. I replaced the tiles:insert with out.println - in this case, the
> filter chain was not getting called and page performance improved
> dramatically.
>
> I want a way to continue using filters and tiles, but avoid the filters
> being called for each tiles:insert.
>
> I have to find a solution to this. Any help is appreciated.
>
> Thanks,
> Bhayzone
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>  				
> ---------------------------------
>  Find out what India is talking about on  - Yahoo! Answers India 
>  Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW
>   


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


RE: Each tiles:insert invokes ServletFilter

Posted by Bhay Zone <bh...@yahoo.co.in>.
Lets assume that I have a 2-D array with the values. I display each cell using a tile. So if a number has to be dispalyed, we have a numeric-tile. Similarly We have a date-tile, we have a percent-tile etc. Using this approach, we maintain consistency in the data dispaly, for e.g we dispaly only two decimal places for all numeric data, All dates are displayed as mm-dd-yyyy. Do you get what we are trying to achieve with this tiles based approach?  Now this tiles approach is used throughout the application (on all web pages). Making a change to this means changing almost all the pages. Now that will be huge in terms of effort and cost.
   
  I was looking for a solution of the following lines:
  The response gets flushed after/before each tile insert - thus invoking the filter. If I can avoid the response from being flushed each time, then maybe the filters will not get called. The tiles:insert tag has an attribute called as 'flush', which when set to false, does not flush the response. But doing that does not seem to be working for  me. I also tried setting buffer="2700k" autoFlush="false" in the jsp page directive, but there was no change. Ran out of all tricks and so came here.

  Thanks.
   
   
  
David Friedman <hu...@ix.netcom.com> wrote:
  What, specifically, is stopping you from making the data a 2 dimensional
array and using a c:foreach kind of JSP loop instead of trying a tiles
definition. It would help to explain what this uniformity is that you need
to replicate. Is it something you can lock down with a few site-wide
styles? It sounds like you have some flexibility so perhaps a different
view on that page layout might help the situation.

Regards,
David

-----Original Message-----
From: Bhay Zone [mailto:bhayzone@yahoo.co.in]
Sent: Monday, September 11, 2006 5:11 PM
To: Struts Users Mailing List
Subject: RE: Each tiles:insert invokes ServletFilter

I tried to simplify the problem when I posted my question. Here is the
actual scenario.

Every piece of data displayed on my page is displayed using a tiles -
thats for uniformity across the application. There are around 1000 rows
being dispalyed, and each row has 10 columns (thus the figure 10k).

The business users want to see all the rows on one page. I really have to go
with the tiles / servlet filters thing. That's how the application was
written. It is beyond me to make those decisions. I have to find a way to
optimize the current page. Basically I need to find a way to stop the
filters being called for a tiles:insert. Once that happens, I should be on
my way.


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



 				
---------------------------------
 Find out what India is talking about on  - Yahoo! Answers India 
 Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW

RE: Each tiles:insert invokes ServletFilter

Posted by David Friedman <hu...@ix.netcom.com>.
What, specifically, is stopping you from making the data a 2 dimensional
array and using a c:foreach kind of JSP loop instead of trying a tiles
definition.  It would help to explain what this uniformity is that you need
to replicate.  Is it something you can lock down with a few site-wide
styles?  It sounds like you have some flexibility so perhaps a different
view on that page layout might help the situation.

Regards,
David

-----Original Message-----
From: Bhay Zone [mailto:bhayzone@yahoo.co.in]
Sent: Monday, September 11, 2006 5:11 PM
To: Struts Users Mailing List
Subject: RE: Each tiles:insert invokes ServletFilter

I tried to simplify the problem when I posted my question. Here is the
actual scenario.

  Every piece of data displayed on my page is displayed using a tiles -
thats for uniformity across the application. There are around 1000 rows
being dispalyed, and each row has 10 columns (thus the figure 10k).

The business users want to see all the rows on one page. I really have to go
with the tiles / servlet filters thing. That's how the application was
written. It is beyond me to make those decisions. I have to find a way to
optimize the current page. Basically I need to find a way to stop the
filters being called for a tiles:insert. Once that happens, I should be on
my way.


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


RE: Each tiles:insert invokes ServletFilter

Posted by Bhay Zone <bh...@yahoo.co.in>.
I tried to simplify the problem when I posted my question. Here is the actual scenario.
   
  Every piece of data displayed on my page is displayed using a tiles - thats for uniformity across the application. There are around 1000 rows being dispalyed, and each row has 10 columns (thus the figure 10k). 

The business users want to see all the rows on one page. I really have to go with the tiles / servlet filters thing. That's how the application was written. It is beyond me to make those decisions. I have to find a way to optimize the current page. Basically I need to find a way to stop the filters being called for a tiles:insert. Once that happens, I should be on my way. 

David Friedman <hu...@ix.netcom.com> wrote:
  Have you considered looking at a template engine such as Velocity or
Freemarker? I'm sure it would have greater efficiency than reinvoking the
servlet and filter chains 10k times. And yes, I will hold back my urge to
ask why you are putting 10k items on any page in the first place.

Regards,
David

-----Original Message-----
From: Bhay Zone [mailto:bhayzone@yahoo.co.in]
Sent: Monday, September 11, 2006 4:12 PM
To: user@struts.apache.org
Subject: Each tiles:insert invokes ServletFilter


Hi,

I have a jsp page in which tiles:insert is called 10,000 times. I have 7
servlet filters defined in the application. My problem is that for each
tiles:insert the entire filter chain is also invoked. This degrades my page
rendering. I replaced the tiles:insert with out.println - in this case, the
filter chain was not getting called and page performance improved
dramatically.

I want a way to continue using filters and tiles, but avoid the filters
being called for each tiles:insert.

I have to find a solution to this. Any help is appreciated.

Thanks,
Bhayzone



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



 				
---------------------------------
 Find out what India is talking about on  - Yahoo! Answers India 
 Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW

RE: Each tiles:insert invokes ServletFilter

Posted by David Friedman <hu...@ix.netcom.com>.
Have you considered looking at a template engine such as Velocity or
Freemarker?  I'm sure it would have greater efficiency than reinvoking the
servlet and filter chains 10k times.  And yes, I will hold back my urge to
ask why you are putting 10k items on any page in the first place.

Regards,
David

-----Original Message-----
From: Bhay Zone [mailto:bhayzone@yahoo.co.in]
Sent: Monday, September 11, 2006 4:12 PM
To: user@struts.apache.org
Subject: Each tiles:insert invokes ServletFilter


Hi,

  I have a jsp page in which tiles:insert is called 10,000 times. I have 7
servlet filters defined in the application.  My problem is that for each
tiles:insert the entire filter chain is also invoked. This degrades my page
rendering. I replaced the tiles:insert with out.println - in this case, the
filter chain was not getting called and page performance improved
dramatically.

  I want a way to continue using filters and tiles, but avoid the filters
being called for each tiles:insert.

  I have to find a solution to this. Any help is appreciated.

  Thanks,
  Bhayzone



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