Velocity Picks up Speed
Some of the most exciting projects in Java are intended for Web servers, where Java applications can deliver dynamic Web content, store, retrieve, and display database information, and execute Java code embedded in Web pages. The opportunity to write some of these Web applications, called servlets, is one of the best reasons to learn the Java language.
Sunday, December 15th, 2002
Some of the most exciting projects in Java are intended for Web servers, where Java applications can deliver dynamic Web content, store, retrieve, and display database information, and execute Java code embedded in Web pages. The opportunity to write some of these Web applications, called servlets, is one of the best reasons to learn the Java language.
While Java is great for programmer productivity, using Java for Web applications poses a challenge for the Web site development team as a whole: how can Web designers and Java programmers work together and not clobber each other? When a site is being developed, it’s rare for the same people to create the content and appearance of the site and handle the programming.
Many Web site development projects choose to use Java Server Pages (JSP), a component of Java’s servlet technology, to place Java code on a Web page alongside HTML or XHTML markup. Using JSP, the embedded Java code is executed by the Web server when the page is requested by a client, and produces HTML or XHTML that’s woven seamlessly into the transmitted page.
JSP code is Java, making it easy to learn. Here’s a simple JSP example that uses a for loop to display an array of objects on a Web page: