Chapter 21: Writing Java servlets and JavaServer Pages

Learn about Java servlets and JavaServer pages -- what they are, how they work, and how to build them into your Web content.

One of the most exciting and dynamic areas of growth in Java is the use of a Web server as an application development platform. The Java language has moved beyond applications that run on your computer and applets that run on a World Wide Web page.

Servlets, Web applications run by a server over the Internet and presented by a Web browser, employ Java without the prohibitive security restrictions in place for applets. A servlet can use all the features of the language. Using servlets, you can collect input from users through Web page forms, present records from a database or another source, and create Web pages dynamically. This approach can be enhanced by JavaServer Pages (JSP), a way to create Web pages that mix static HTML with the output of servlets and Java expressions.

JavaServer Pages enable nonprogrammers to work on Web sites developed with Java.

In this chapter from the book SAMS Teach Yourself Java 2 in 21 Days, by Rogers Cadenhead and Laura Lemay, you'll learn about the following topics:

  • How servlets differ from applications and applets
  • How to run servlets as part of the Apache Web server and other servers
  • How to receive data from a Web page form
  • How to store and retrieve cookies
  • How to use servlets to dynamically generate Web content
  • How to create a JavaServer Page
  • How to use Java variables, expressions, and statements on a page

    Click here to download this free book chapter.

  • Dig Deeper on Java for Lotus Notes Domino

    Start the conversation

    Send me notifications when other members comment.

    Please create a username to comment.




    • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

    • V6R1 upgrade planning checklist

      When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

    • Connecting multiple iSeries systems through DDM

      Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...