A javaee website to create events and invite friends to join in
The aim of this project is to provide a hand-coded JavaEE website.
This website lets an author to create events and to invite some guests to subscribe to those events. Each author can register or login to the website with a password which will be hashed before being stored in a database.
Clone the project into your workspace.
Download the java development kit: jdk 1.8.0_111.
Create an environment variable called JAVA_HOME pointing on the bin folder of the jdk.
Add the variable to the Path.
Download the build automation tool: apache-maven-3.3.9-bin.
Create an environment variable called MAVEN_HOME pointing on the bin folder of maven.
Add the variable to the Path.
Download the application server: wildfly-10.0.0.Final.
Create an environment variable called JBOSS_HOME pointing on the bin folder of WildFly.
Go to the bin folder of WildFly.
To add a new user, run:
For Linux | For Windows |
---|---|
add-user.sh | add-user.bat |
Go to the bin folder of WildFly and run:
For Linux | For Windows | For a remote Linux server |
---|---|---|
standalone.sh | standalone.bat | standalone.sh -b 0.0.0.0 |
create the database:
Find the database source file (website.sql) containing the tables creation script. It will be called $FILE and its path will be called $PATH in the following table.
For Linux | For Windows |
---|---|
Download MySQL: sudo apt install mysql-server . |
Download easyPHP and run it. |
Start MySQL: sudo service mysql start . |
Open the administration. |
Start the MySQL console: mysql -u root -p . |
Then, open the administration module MySQL : PhpMyAdmin 4.1.4. |
mysql> CREATE DATABASE website; | Create a new database named website. |
mysql> USE website; | Select the database: website. |
mysql> SOURCE $PATH$FILE; | Go to the ‘import’ tab. |
mysql> quit; | Import $FILE file located into $PATH. |
setup WildFly to connect to the database:
Download the driver mysql-connector-java-5.1.4.
1. Open the administration of WildFly.
2. Go to “Deployments” and click on “Add”.
Upload a new deployment.
Find mysql-connector-java-5.1.40-bin.jar.
3. Go to “Configuration”, then “Subsystems”, then “DataSources”, then “Non-XA”. Click on “Add”.
Choose DataSource: MySQL Datasource
On step 1/3, set:
Name: website
JNDI Name: java:jboss/DataSources/website (name used in persistence.xml <jta-data-source>)
On step 2/3 go to the tab “Detected Driver” and choose: mysql-connector-java-5.1.40-bin.jar_com.mysql.jdbc.Driver_5_1
On step 3/3, set:
Connection URL: jdbc:mysql://localhost:3306/website
Username: (yourDatabaseUsername)
Password: (yourDatabasePassword)
setup WildFly to connect to the mail box:
Open the administration of WildFly.
1. Go to “Configuration”, then “Socket Binding” and click on “View”.
Click on “View>”, then on “OutBound Remote”, then on “Add” and set:
Name: (what ever name you want, for ex: mail-smtp-gmail)
Host: smtp.gmail.com
Port: 465 (587 should work too)
Save
2. Go to “Configuration”, then “Subsystems”, then”Mail”, click on “Add” and set:
Name: java:jboss/mail/gmail
JNDI Name: java:jboss/mail/gmail (name of the resource used in 'EmailObserver.java')
Save
Click on your Mail Session, then click on “View”, then on “Add” and set:
Socket Binding: (Socket Binding name, in our ex: mail-smtp-gmail)
Type: smtp
Username: (youremail@gmail.com)
Password: (yourEmailPassword)
Use SSL (tick)
Save
3. Restart WildFly (in the shell: “Ctrl+C”, then start the server).
setup your mail box to accept external applications:
1. Authorize less secure applications to access to your email service (for Gmail, go there).
2. Check that the outgoing mails analysis is disable in your anti-virus.
For Linux | For Windows |
---|---|
Start MySQL: sudo service mysql start |
Run easyPHP |
Starting the server
In the CLI, go to the root folder of the java project, containing the pom.xml.
Type the command: mvn clean wildfly:deploy
After running the project, go to http://localhost:8080.
Build automation tool: Maven
Layer | Style | Control | Graphical User Interface |
---|---|---|---|
html5 | css3 | javascript | Primefaces |
Template | View |
---|---|
Facelets | JSF (Java Server Faces) |
Application programming interface: JPA (Java Persistence API)
This project have been manually tested with the following browsers:
See also the list of contributors who participated in this project.