Bước 1: Tạo New Project(Ctrl + Shift + N). Dưới Categories, chọn Java Web. Dưới Projects, chọn Web Application sau đó nhấn Next.
Nhập tên "HelloWeb" trong text box Project name.
Bước 2: Tạo Java Package
Trong cửa sổ Projects, mở rộng cây thư mục Source Packages. Chú ý cây thư mục Source Packages chỉ có cây package duy nhất.
Chuột phải lên cây Source Packages và chọn New > Java Class. Nhập NameHandler trong Class Name text box and nhập org.mypackage.hello trong combo box Package. Click Finish. 
Nhập Code sau cho class NameHandler
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.mypackage.hello;
/**
 *
 * @author DOTNETGROUP
 */
public class NameHandler {
    private String name;
    public NameHandler() { name=null;}
    /**
     * @return the name
     */
    public String getName() {
        return name;
    }
    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }
    
}
Bước 3: Chỉnh sửa index.jsp và response.jsp
index.jsp
<%-- 
    Document   : index
    Created on : Feb 17, 2014, 2:25:01 PM
    Author     : DOTNETGROUP
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h1>Hello World!</h1>
        <form name="Name Input Form" action="response.jsp">
            <input type="text" name="name" value="" size="20px" /> 
            <input type="submit" value="OK" />
        </form>
    </body>
</html>
response.jsp
<%-- 
    Document   : response.jsp
    Created on : Feb 17, 2014, 2:42:43 PM
    Author     : DOTNETGROUP
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <jsp:useBean id="mybean" scope="session" class="org.mypackage.hello.NameHandler" />
        <jsp:setProperty name="mybean" property="name" />
        <h1>Hello <jsp:getProperty name="mybean" property="name" />!</h1>
        
    </body>
</html>
Nhấn F6 để chạy chương trình.
Hình ảnh bố trí cây thư mục: