This project is a lightweight and easy-to-use skeleton to create a JEE application that uses Apache TomEE, a complete JEE server based on Tomcat.
-
main/java/car/tp4/entityContains all entities (EJB) (
Bookbean example). -
main/java/car/tp4/servletContains all servlets (
HelloServletexample). -
resources/META-INFContains all the configuration files for the deployment.
persistence.xmldeclares how to persist the app beans. We have to write apersistence-unitfor each bean of the application. -
webapp/jsp
Contains all the jsp files, excepts the index.
webapp/WEB-INF
Contains all the configuration files for the web application.
The mapping between each URL/Servlet has to be down in the web.xml file (see example).
To build the application and to start the server:
mvn clean package tomee:run
Once started, the application is now reachable at:
http://localhost:8080
A Servlet and a JSP file is available for testing at:
http://localhost:8080/hello
When developing, all the static resources (html, css, jsp) are automatically re-deployed on the server (in few seconds).
For the Java class, you can open a new terminal (without to stop the server), and package the application (mvn package) for a new automatic redeployment.
To clean all data and remove the application, use mvn:clean.