Increment Sample

This is the next-to-simplest sample enterprise bean in our gallery. It shows you how to include basic processing in the enterprise bean structure.

Run this sample

Show the source files

Reminder: Before you can run any of the sample enterprise beans, you must deploy them.


How this sample works:

The sample has:

  • An input form to invoke the servlet
  • A Java servlet, IncrementServlet, that accesses the Increment enterprise bean and returns the formatted HTML
  • An enterprise bean, Increment, that adds 1 to a counter and returns the value of the counter.

How to use this sample:

This sample is adds a little bit of processing to the Hello enterprise bean. These two samples, Hello and Increment, are a good place to start learning how to write beans that follow the EJB architecture.