1.

How Do You Optimize A Jsp Page?

Answer»

• Use JSPINIT() method to cache static data
• Use StringBuffer rather than using + operator when you concatenate multiple strings
• Use print() method rather than println() method
• Use ServletOutputStream instead of JSPWriter to send binary data
• Initialize the 'out' object (implicit object) with proper size in the page directive.
• Flush the data partly.
• Minimize code in the synchronized block.
• Set the content length.
• Release resources in JSPDESTROY() method.
• Give 'false' value to the session in the page directive to avoid session object creation.
• Use include directive instead of include action when you want to include the child page content in the translation PHASE.
• Avoid giving unnecessary scope in the 'useBean' action.
• Do not use custom TAGS if you do not have reusability.
• Use application server caching facility.
• Use Mixed session mechanisms such as 'session' with hidden fields.
• Use 'session' and 'application' as cache.
• Use caching tags provided by different organizations like openSymphony.com.
• Remove 'session' objects explicitly in your program WHENEVER you finish the task.
• Reduce session time out value as much as possible.
• Use 'transient' variables to reduce serialization overhead if your session tracking mechanism uses serialization process.
• Disable JSP auto reloading feature.

• Use jspInit() method to cache static data
• Use StringBuffer rather than using + operator when you concatenate multiple strings
• Use print() method rather than println() method
• Use ServletOutputStream instead of JSPWriter to send binary data
• Initialize the 'out' object (implicit object) with proper size in the page directive.
• Flush the data partly.
• Minimize code in the synchronized block.
• Set the content length.
• Release resources in jspDestroy() method.
• Give 'false' value to the session in the page directive to avoid session object creation.
• Use include directive instead of include action when you want to include the child page content in the translation phase.
• Avoid giving unnecessary scope in the 'useBean' action.
• Do not use custom tags if you do not have reusability.
• Use application server caching facility.
• Use Mixed session mechanisms such as 'session' with hidden fields.
• Use 'session' and 'application' as cache.
• Use caching tags provided by different organizations like openSymphony.com.
• Remove 'session' objects explicitly in your program whenever you finish the task.
• Reduce session time out value as much as possible.
• Use 'transient' variables to reduce serialization overhead if your session tracking mechanism uses serialization process.
• Disable JSP auto reloading feature.



Discussion

No Comment Found