Skip to content

Latest commit

 

History

History
59 lines (44 loc) · 2.57 KB

README.adoc

File metadata and controls

59 lines (44 loc) · 2.57 KB

temperature-converter: Stateless Session EJB (SLSB)

The temperature-converter quickstart does temperature conversion using an EJB Stateless Session Bean (SLSB), CDI, and a JSF front-end client.

What is it?

The temperature-converter example demonstrates the use of an EJB Stateless Session Bean (SLSB) and CDI, accessed using a JSF, and deployed to {productNameFull} using a WAR archive.

The application does the following:

  1. The User Interface is a JSF page that asks for a temperature and a scale (Fahrenheit or Celsius).

  2. When you click on Convert, the temperature string is passed to the TemperatureConverter controller (managed) bean.

  3. The managed bean then invokes the convert() method of the injected TemperatureConvertEJB (notice the field annotated with @Inject).

  4. The response from TemperatureConvertEJB is stored in the temperature field of the managed bean.

  5. The managed bean is annotated as @SessionScoped, so the same managed bean instance is used for the entire session.

Building and running the quickstart application with a {productName} server distribution

Access the Application

The application will be running at the following URL: http://localhost:8080/{artifactId}/.

You will be presented with a simple form for temperature conversion.

  1. Optionally, Select a scale: Celsius or Fahrenheit.

  2. Enter a temperature.

  3. Press the Convert button to see the results.