Optimize the JSP tips

Dear All ,

This is some optimization tips that i do not understand ,any one can explain

1.Code that is frequently used (such as connection and disconnection ,frequently used static queries ,etc) are repeated throughout the JSP .

Resolutions : Create Java classes or beans to encapsulate this code .Use the <JSP:useBean> directive to include this classes/beans in the JSP to reduce and reuse code.

Question : It is simple reduce the coding then indirectly boost the performance by reducing the total lenght of coding and do compilation.

2.HTML formatting code is quite hopelessy mingled with embedded scripting code (in Java)

Resolutions : Create sets of custom tag extensions to hide the database operations from the HTML page developer ,and to greatly reduce the need for embedded scripting code .Custom tag extension are introduced in JSP 1.1 specifically for this reason .

Question : What is the custom tag extension ,what is the benefit of it and why it is implemended .

[1029 byte] By [wikeya] at [2007-9-19]
# 1

Sorry guys ,wrong question ..any how please give an input if you know it.

This is some optimization tips that i do not understand ,any one can explain

1.Code that is frequently used (such as connection and disconnection ,frequently used static queries ,etc) are repeated throughout the JSP .

Resolutions : Create Java classes or beans to encapsulate this code .Use the <JSP:useBean> directive to include this classes/beans in the JSP to reduce and reuse code.

Question : Is it simply reduce the coding then indirectly boost the performance .By reducing the total lenght of coding then compilation will be faster .Is that correct ?

2.HTML formatting code is quite hopelessy mingled with embedded scripting code (in Java)

Resolutions : Create sets of custom tag extensions to hide the database operations from the HTML page developer ,and to greatly reduce the need for embedded scripting code .Custom tag extension are introduced in JSP 1.1 specifically for this reason .

Question : What is the custom tag extension ,what is the benefit of it and why it is implemended .

wikeya at 2007-7-8 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 2

Neither of these sound like 'optimizations' to me... they both relate to making

the code in the page more maintainable and (perhaps) reusable.

1. I doubt compilation will be significantly faster; it will be a little since the beans

are precompiled - but then, page compilation itself should be a one-off hit in a

production environment. So you save the first visitor (probably your testers!)

a few fractions of a second. Hardly worth it from a speed point of view.

2. See Sun's tutorial on taglibs for more information. It won't buy you anything

in terms of speed the bean approach won't, but may provide better reusability

of code and aid task separation between coders and page authors. If such a

thing exists :>

Also see the J2EE blueprint book (view helper and composite view patterns).

darrosea at 2007-7-8 > top of java,Enterprise & Remote Computing,Web Tier APIs...