A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.oracle.com/javaee/7/tutorial/dukes-tutoring002.htm below:

58.2 Main Interface - Java Platform, Enterprise Edition: The Java EE Tutorial (Release 7)

58.2 Main Interface

The main interface allows students and staff to check students in and out, and record when students are outside at the playground.

58.2.1 Java Persistence API Entities Used in the Main Interface

The following entities used in the main interface encapsulate data stored and manipulated by Duke's Tutoring, and are located in the dukestutoring.entity package in the dukes-tutoring-common project.

For information on creating Java Persistence API entities, see Chapter 37, "Introduction to the Java Persistence API." For information on validating entity data, see Validating Persistent Fields and Properties and Chapter 22, "Bean Validation: Advanced Topics."

58.2.2 Enterprise Beans Used in the Main Interface

The following enterprise beans used in the main interface provide the business logic for Duke's Tutoring, and are located in the dukestutoring.ejb package in the dukes-tutoring-war project:

For information on creating and using enterprise beans, see Enterprise Beans. For information on creating strongly typed Criteria API queries, see Chapter 40, "Using the Criteria API to Create Queries." For information on CDI events, see Using Events in CDI Applications.

58.2.3 WebSocket Endpoint Used in the Main Interface

The javaeetutorial.dukestutoring.web.websocket.StatusEndpoint class is a WebSocket server endpoint that returns students and their status to client endpoints. The StatusEndpoint.updateStatus method is a CDI observer method for the StatusEvent event. When a student's status changes in the main interface, a StatusEvent is fired. The updateStatus observer method is called by the container, and pushes out the status change to all the client endpoints registered with StatusEndpoint.

The index.xhtml JavaServer Faces page contains JavaScript code to connect to the WebSocket endpoint. The onMessage method on this page clicks a JavaServer Faces button, which makes an Ajax request to refresh the table that shows the current status of the students.

For more information on WebSocket endpoints, see Chapter 18, "Java API for WebSocket." For information on CDI events, see Using Events in CDI Applications.

58.2.4 Facelets Files Used in the Main Interface

The Duke's Tutoring application uses Facelets to display the user interface, making extensive use of the templating features of Facelets. Facelets, the default display technology for JavaServer Faces technology, consists of XHTML files located in the tut-install/examples/case-studies/dukes-tutoring-war/src/main/webapp/ directory.

The following Facelets files are used in the main interface:

For information on using Facelets, see Chapter 8, "Introduction to Facelets."

58.2.5 Helper Classes Used in the Main Interface

The following helper classes, found in the dukes-tutoring-common project's dukestutoring.util package, are used in the main interface.

58.2.6 Properties Files

The strings used in the main interface are encapsulated into resource bundles to allow the display of localized strings in multiple locales. Each of the properties files has locale-specific files appended with locale codes, containing the translated strings for each locale. For example, Messages_es.properties contains the localized strings for Spanish locales.

The dukes-tutoring-common project has the following resource bundle under src/main/resources/.

The dukes-tutoring-war project has the following resource bundles under src/main/resources/.

For information on localizing web applications, see Registering Application Messages.

58.2.7 Deployment Descriptors Used in Duke's Tutoring

Duke's Tutoring uses these deployment descriptors in the src/main/webapp/WEB-INF directory of the dukes-tutoring-war project:

Duke's Tutoring also uses the following deployment descriptor in the src/main/resources/META-INF directory of the dukes-tutoring-common project:

No enterprise bean deployment descriptor is used in Duke's Tutoring. Annotations in the enterprise bean class files are used for the configuration of enterprise beans in this application.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3