Skip to content

Commit b6aa0ff

Browse files
authored
Merge pull request #24 from mendrika261/dev
update: README.md
2 parents 5d6d975 + 1666e15 commit b6aa0ff

File tree

1 file changed

+55
-5
lines changed

1 file changed

+55
-5
lines changed

README.md

Lines changed: 55 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ DONE
2323
**TODO**
2424

2525
10. [ ] Database integration
26-
11. [ ] Error reporting (404 error page...)
26+
11. [ ] Error page (404, 500...)
2727
12. [ ] Log system
2828
13. [ ] Security improvements
2929
14. [ ] Full Documentation <br>
@@ -38,11 +38,12 @@ DONE
3838
| OS 💻 | can run bash script |
3939

4040
## Installation 🚀
41-
Get the last released version from the [releases page](https://github.com/mendrika261/S4-Java-Framework/releases/tag/v0.1)
42-
- Demo version contains examples of use and some test
43-
- Production version contains only the framework
41+
There is 3 versions, get the last released from the [releases page](https://github.com/mendrika261/S4-Java-Framework/releases/tag/v0.1)
42+
- Production version: contains the framework with `framework.sh` manager
43+
- Manual version: contains only `framework.jar`. See manual installation [below](#manual-installation)
44+
- Demo version: production version with a demo project
4445

45-
### First configuration
46+
### First configuration (production version)
4647
- Open `conf.env` file and set all: jdk, tomcat, information about your project like where the project will be created<br>
4748
If it is not in your file get it from [here](https://github.com/mendrika261/S4-Java-Framework/blob/v0.1/conf.env) and change
4849
- Then, give permissions for `framework.sh` the script that will help you to manage the framework
@@ -62,6 +63,55 @@ sudo chmod +x framework.sh
6263
> The script will compile your project and run it in tomcat with `auto reload` feature enabled,
6364
for `*.xml` or any configurations changed you might sometimes need to restart tomcat ⚠️
6465

66+
### Manual installation
67+
After downloading the jar file, you can add it to your lib project and use it as a dependency.
68+
#### Configure app.xml
69+
Create a file `app.xml` in your project and copy the basic configuration below.
70+
```xml
71+
<?xml version="1.0" encoding="utf-8" ?>
72+
73+
<app>
74+
<config id="auth">
75+
<session name="profile" />
76+
<profiles>
77+
<profile name="AUTH_PROFILE_ADMIN" value="admin" />
78+
<profile name="AUTH_PROFILE_USER" value="user" />
79+
</profiles>
80+
<redirections>
81+
<redirect name="AUTH_REDIRECT_LOGIN" value="/" />
82+
<redirect name="AUTH_REDIRECT_LOGOUT" value="/login" />
83+
</redirections>
84+
</config>
85+
</app>
86+
```
87+
#### Configure web.xml by adding the servlet to handle all requests
88+
> You must set PACKAGE_ROOT and CONFIG_FILE parameters
89+
```xml
90+
...
91+
<!-- This is the main servlet of the framework -->
92+
<servlet>
93+
<servlet-name>FrontServlet</servlet-name>
94+
<servlet-class>etu2024.framework.servlet.FrontServlet</servlet-class>
95+
<init-param>
96+
<!-- The root package of your project -->
97+
<param-name>PACKAGE_ROOT</param-name>
98+
<param-value>.../popo/src/main/java/</param-value>
99+
</init-param>
100+
<init-param>
101+
<!-- The path to the configuration file -->
102+
<param-name>CONFIG_FILE</param-name>
103+
<param-value>.../popo/src/app.xml</param-value>
104+
</init-param>
105+
</servlet>
106+
107+
<!-- All the requests are processed by FrontServlet -->
108+
<servlet-mapping>
109+
<servlet-name>FrontServlet</servlet-name>
110+
<url-pattern>/</url-pattern>
111+
</servlet-mapping>
112+
...
113+
```
114+
65115
## Usage 🧑‍🍳
66116
> Let's learn by examples, it is the best (and fastest) way to learn. ℹ️
67117

0 commit comments

Comments
 (0)