项目作者: JeremyPansier

项目描述 :
A javaee website to create events and invite friends to join in
高级语言: Java
项目地址: git://github.com/JeremyPansier/JavaEE_website.git
创建时间: 2017-03-23T21:58:44Z
项目社区:https://github.com/JeremyPansier/JavaEE_website

开源协议:The Unlicense

下载


JavaEE website

Build Status
Quality Gate
Lines of code
Maintainability
Security
Duplicated Lines

Table of Contents

Overview

General Purpose

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.

Use case

use case

Data model

data model

Getting Started

Clone the project into your workspace.

Prerequisites

The java development kit

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.

The build automation tool

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.

The application server

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

Installing

Starting the server

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

Connection to the database

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:

  1. Name: website
  2. 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:

  1. Connection URL: jdbc:mysql://localhost:3306/website
  2. Username: (yourDatabaseUsername)
  3. Password: (yourDatabasePassword)

Connection to the mail box

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:

  1. Name: (what ever name you want, for ex: mail-smtp-gmail)
  2. Host: smtp.gmail.com
  3. Port: 465 (587 should work too)

Save


2. Go to “Configuration”, then “Subsystems”, then”Mail”, click on “Add” and set:

  1. Name: java:jboss/mail/gmail
  2. 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:

  1. Socket Binding: (Socket Binding name, in our ex: mail-smtp-gmail)
  2. Type: smtp
  3. Username: (youremail@gmail.com)
  4. Password: (yourEmailPassword)
  5. 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.

Running

Starting the database

For Linux For Windows
Start MySQL: sudo service mysql start Run easyPHP

Deployment

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

Testing

Manual test

After running the project, go to http://localhost:8080.

Built With

Structure

Build automation tool: Maven

Front-end

Layer Style Control Graphical User Interface
html5 css3 javascript Primefaces

Back-end

Template View
Facelets JSF (Java Server Faces)

Persistence

Application programming interface: JPA (Java Persistence API)

Supported browsers

This project have been manually tested with the following browsers:

  • Google Chrome 65, Chromium 51
  • Mozilla Firefox 59
  • Internet Explorer 11
  • Opera 51
  • Safari 5.1.7

Authors

See also the list of contributors who participated in this project.

Acknowledgments

  • Special thanks to my brother Gwenall Pansier who helped me from my early days as a developer.
  • Thanks to Thomas Gros, the trainer who teached me basics in JavaEE.
  • Thanks to Pascal Cunin, my schoolmate, with whom I started this project.

License

copyleft
http://unlicense.org/