Previous Next vertical dots separating previous/next from contents/index/pdf

Creating Forms for Collecting User Data

The following topic describes how Beehive NetUI supports the submission of user data.

HTML Forms and Form Beans

Suppose you want your web application to collect data from users, such as the user's name, email, etc. Beehive NetUI supports user data submission through a three step process: (1) First the user enters data into an ordinary HTML form. (2) Upon submission that data is loaded into a Java object called a form bean. (3) Once the submitted data has been packaged as a form bean, the Controller class is free to operate on the data: typically the form bean is passed to one of the Controller class's action methods for further processing.

Form beans are Java representations of the user-facing HTML form. In particular they are standard JavaBean representations of HTML forms: for each data field in the HTML form, the form bean has a corresponding member field and getter/setter methods. For example, the following HTML form has two data fields: firstname and lastname.

  <netui:form action="updateCustomer">
		<netui:textBox dataSource="actionForm.customer.firstName" id="field2"></netui:textBox>
		<netui:textBox dataSource="actionForm.customer.lastName" id="field3"></netui:textBox>

Its corresponding form bean has two member fields, the Strings firstname and lastname, each with setter/getter fields:

public class Customer implements Serializable {
	private static final long serialVersionUID = 1L;
	private String firstName = "";

	private String lastName = "";

	public Customer(String firstName, String lastName) {

		this.firstName = firstName;
		this.lastName = lastName;

	public String getFirstName() {
		return firstName;

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	public String getLastName() {
		return lastName;

	public void setLastName(String lastName) {
		this.lastName = lastName;

An instance of this form bean gets passed to the action method for further processing by the Controller class.

public Forward updateCustomer(Customer form)

For more infomation about form beans, HTML forms and action methods see the Apache Beehive documentation Handling Forms.

Repeating Form Elements

The Beehive NetUI tag libraries supports advanced form element repeater tags. These tags allow you to render forms dynamically. For more information on dynamically rendered repeating forms, see the Apache Beehive documentation NetUI Repeating Form Control Tags.

Using the Create Form Wizard

Workshop for Weblogic Platform provides powerful tools for building Beehive NetUI forms. For more information see Tutorial: Accessing Controls from a Web Application: Step 4: Create a Page to Edit Customer Data.

Related Topics

NetUI Form Control Tags

NetUI Repeating Form Control Tags


Skip navigation bar   Back to Top