Home  >  Article  >  Database  >  提升JSP应用程序的七大绝招_MySQL

提升JSP应用程序的七大绝招_MySQL

WBOY
WBOYOriginal
2016-06-01 14:06:471040browse

  你时常被客户抱怨JSP页面响应速度很慢吗?你想过当客户访问次数剧增时,你的WEB应用能承受日益增加的访问量吗?本文讲述了调整JSP和servlet的一些非常实用的方法,它可使你的servlet和JSP页面响应更快,扩展性更强。而且在用户数增加的情况下,系统负载会呈现出平滑上长的趋势。在本文中,我将通过一些实际例子和配置方法使得你的应用程序的性能有出人意料的提升。其中,某些调优技术是在你的编程工作中实现的。而另一些技术是与应用服务器的配置相关的。在本文中,我们将详细地描述怎样通过调整servlet和JSP页面,来提高你的应用程序的总体性能。在阅读本文之前,假设你有基本的servlet和JSP的知识。


throws IOException, ServletException
{
 OutputStream out = null
 String encoding = request.getHeader("Accept-Encoding");
 if (encoding != null && encoding.indexOf("gzip") != -1)
 {
  request.setHeader("Content-Encoding" , "gzip");
  out = new GZIPOutputStream(request.getOutputStream());
 }
 else if (encoding != null && encoding.indexOf("compress") != -1)
 {
  request.setHeader("Content-Encoding" , "compress");
  out = new ZIPOutputStream(request.getOutputStream());
 }
 else
 {
  out = request.getOutputStream();
 }
 ...
 ...

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn