ServersServlets and JSP: An Overview Page 4

Servlets and JSP: An Overview Page 4

ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.




Servlets are Java technology’s answer to CGI programming; JSP is a technology that lets users mix regular, static HTML with dynamically-generated HTML. This tutorial discusses the basics of Java Servlets and JSP, and the advantages of using each of these technologies.

What Are the Advantages of JSP?

  • JSP vs. Server-Side Includes (SSI). SSI is a widely-supported technology for including externally-defined pieces into a static Web page. JSP is better because it lets you use servlets instead of a separate program to generate that dynamic part. Besides, SSI is really only intended for simple inclusions, not for “real” programs that use form data, make database connections, and the like.
  • JSP vs. JavaScript. JavaScript can generate HTML dynamically on the client. This is a useful capability, but only handles situations where the dynamic information is based on the client’s environment. With the exception of cookies, HTTP and form submission data is not available to JavaScript. And, since it runs on the client, JavaScript cannot access server-side resources like databases, catalogs, pricing information, and the like.
  • JSP vs. Static HTML.Regular HTML, of course, cannot contain dynamic information. JSP is so easy and convenient that it is quite feasible to augment HTML pages that only benefit marginally by the insertion of small amounts of dynamic data. Previously, the cost of using dynamic data would preclude its use in all but the most valuable instances.

Get the Free Newsletter!

Subscribe to Daily Tech Insider for top news, trends & analysis

Latest Posts

Related Stories