DONE
- Singleton class
- Session
- Auth with many profiles
- Return Json (via modelView)
- Rest API (direct returning object)
- File upload or input array
-
app.xml
external configuration file -
framework.sh
manager and auto-reload
TODO
10. [ ] Database integration
11. [ ] Error reporting (404 error page...)
12. [ ] Log system
13. [ ] Security improvements
14. [ ] Full Documentation
... and more
Requirements | Version |
---|---|
JDK ☕️ | equal or upper 17 |
Tomcat 🐱 | equal or upper 10 |
Gson library 📚 | 2.10 (provided ✅) |
Get the last released version from the releases page
- Demo version contains examples of use and some test
- Production version contains only the framework
- Open
conf.env
file and set all: jdk, tomcat, information about your project like where the project will be created
If it is not in your file get it from here and change - Then, give permissions for
framework.sh
the script that will help you to manage the framework
sudo chmod +x framework.sh
- Finally,
init
your repository for a weby project
./framework.sh --init
- To run your project you can use the script
framework.sh
, makeframework.sh --help
to see all options
./framework.sh --run
The script will compile your project and run it in tomcat with
auto reload
feature enabled, for*.xml
or any configurations changed you might sometimes need to restart tomcat⚠️
Let's learn by examples, it is the best (and fastest) way to learn. ℹ️
import etu2024.framework.annotation.Auth;
import etu2024.framework.core.ModelView;
...
@Url(url = "/") // The url where the controller will be called
public ModelView index() {
ModelView modelView = new ModelView(); // A class to manage the view
modelView.setView("home.jsp"); // The page to render
return modelView;
}
...
...
// The class where all process will be done
ModelView modelView = new ModelView();
// Add a variable to the view
modelView.addItem("name", "Weby");
// The page to render
modelView.setView("home.jsp");
...
Attributes and parameters are filled automatically
public class Customer()
private String name;
...
public ModelView getCustomer(String id) {
ModelView modelView = new ModelView();
// Access directly to the variable name and id
modelView.setView("home.jsp");
return modelView;
}
...
...
ModelView modelView = new ModelView();
return modelView.redirect("/home");
...