Chapter 22. JavaServer Pages (JSP)


Java™ 2 Primer Plus
By Steven Haines, Steve Potts

Table of Contents
Part V:  Web Technologies

You will learn about the following in this chapter:

  • Setting up a Java Web environment

  • What JSP is and is not

  • How JSPs work

  • How to program JSPs

  • Deploy and run JSPs

Java servlets were a hit from day one. The ability to use Java code on the server released the programmer from having to use three or four different technologies to get a Web application up and running.

Not every aspect of the servlet's architecture was well received, however. Programmers had to use the out.println() method on every line of HTML code that was to be output, which proved to be very tedious. True, programmers could write classes that allowed the HTML text to be passed in as a parameter, but this was only slightly better than the println() methods.

Another problem with servlets was that they tended to grow to amazing lengths. One servlet would contain code to communicate with the browser, mixed with code to provide presentation logic, which was also mixed with business logic.

What was needed was a way to write some sort of scripts inside the HTML statements themselves, in a manner similar to Microsoft's Active Server Pages (ASP), but vendor-neutral and integrated with the servlet and class architecture that was already on the server. The solution that Sun's engineers came up with was called JavaServer Pages (JSP).


    Java 2 Primer Plus
    Java 2 Primer Plus
    ISBN: 0672324156
    EAN: 2147483647
    Year: 2001
    Pages: 332

    Similar book on Amazon © 2008-2017.
    If you may any questions please contact us: