x
Loading
 Loading
Hello, Guest | Login | Register

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.

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:

 <p>Customers: <% for (int i = 0; i < 3; i++) { %> <p><%= cust[i].name %> <p><%= cust[i].address %> <p><%= cust[i].city %> <%= cust[i].state %> <%= cust[i].zip %> <% if (cust[i].current) {…

Please log in to view this content.

Not Yet a Member?

Register with LinuxMagazine.com and get free access to the entire archive, including:

  • Hands-on Content
  • White Papers
  • Community Features
  • And more.
Already a Member?
Log in!
Username

Password

Remember me

Forgotten your password?
Forgotten your username?
Read More
  1. Vimperator: Use Firefox the Vim Way
  2. Customize Chrome for Better Browsing
  3. Jetpack Gearing Up for Production: Look Out Chrome?
  4. Google Buzz: Much Ado about Something
  5. Alternative Browsers: Beyond Chrome and Firefox
Follow Linux Magazine
Rackspace