To-do management application for java. School project for the lecture web -based database applications at DHBW Karlsruhe.
This is an example of a server-side MVC web application realized in Java. The application sets up on the "Jakarta Enterprise Edition" (formerly "Java Enterprise Edition") and therefore runs in a specially designed application server. All application logic is implemented by the server, so that a completely server-generated HTML page is called up for each URL pattern of the application and displayed in the browser.
During the development we used a specially configured Tomee server. The derby database was used as a database. Both are contained in our files that are uploaded to the project delivery. The app uses Maven as a build tool and package management. In this way, the APIs necessary for Jakarta, but no further dependencies, are integrated into the project. The source code of the application is structured as follows:
The following development tools are used:
In the classes justdoit.common.jpa.user and justdoit.common.ejb.userbean, the user administration was realized. The application manages a separate table in the database in which the users, passwords and assigned user groups are saved.
However, authentication and authorization are carried out by the application server, which must be configured accordingly. This means that the application server must know in which tables the users are saved. This is based on the settings in the file /Web Pages/WEB-INF/web.xml .
There are the application -specific settings that require actions which permits require. In the end, the following line is
<realm-name>justdoit</realm-name>
assigned the realm. Realm is only a nice term for any database with users, your passwords and permissions.
In the Tomee, this happens through the following lines in the conf/server.xml configuration file: The definition of the realm is done by the following lines in the file /Web Pages/META-INF/context.xml :
<Realm
className = "org.apache.catalina.realm.DataSourceRealm"
dataSourceName = "Default-Database-Unmanaged"
userTable = "justdoit.justdoit_user"
userNameCol = "username"
userCredCol = "password_hash"
userRoleTable = "justdoit.user_group"
roleNameCol = "groupname"
>
<CredentialHandler
className = "org.apache.catalina.realm.MessageDigestCredentialHandler"
algorithm = "SHA-256"
/>
</Realm>
The database connection mentioned under dataSourceName must be defined as follows in the File conf/tomee.xml :
<Resource id="Derby-Sample-Managed" type="javax.sql.DataSource">
JdbcDriver = org.apache.derby.jdbc.ClientDriver
JdbcUrl = jdbc:derby://localhost:1527/sample
UserName = app
Password = app
JtaManaged = true
</Resource>
<Resource id="Derby-Sample-Unmanaged" type="javax.sql.DataSource">
JdbcDriver = org.apache.derby.jdbc.ClientDriver
JdbcUrl = jdbc:derby://localhost:1527/sample
UserName = app
Password = app
JtaManaged = false
</Resource>
The example is based on the derby example database, which is part of Netbeans.
The email shipping is implemented with the Javamail API. Part of the required settings is saved in a JSON file: src/main/resources/mailConfig.json
{
"from": "",
"host": "",
"port": "",
"username": "",
"password": ""
}
from : Address that should be displayed as the sender address.host : Address of the postal exit gender (SMTP server)port : Port of the output server (SMTP server)username : Username of the account at the mail providerpassword : Password of the account at the mail provider This project is licensed under Creative Commons name 4.0 International
© 2018 - 2019 André Göller, Tim Schneider, Ansgar Lichter