Custom Selection Box Sample

Create a selection box when you don't know what the choices are? Sure. This sample demonstrates how you can use Java servlets and JavaBeans to present variable data in a drop-down selection box on a Web page.

Run this sample

 


How this sample works:

This sample has:

  • An input form to enter data
  • A Java servlet that reads the input data, stores it in a Bean, and returns the output page
  • A JavaServer Page (JSP) that formats the Bean data as choices in a selection box
  • A servlet file that provides information about the servlet to the WebSphere Application Server

The data that you enter in this input form could come from any other source. You can use the techniques in this sample to create a selection box for data you read from a flat file or from a database.


How to use this sample on your web page:

Many of the Studio wizards format the variable data you retrieve from your databases into an HTML table. This sample shows you how to code your JSP tags so that this data can be part of an interactive HTML form.