easywebexample (1)
This section will describe basic configuration for EasyWeb in web.xml file. When we need used EasyWeb framework in our project, we should configure it in web.xml file, make it enabled.
Add servlet container listener
This listener class will loaded when servlet container(Tomcat/Jetty) startup, and initialize EasyWeb framework : 1. initialize and instance WebContext 2. call Bootstarp#initial() if configured in WebContext 3. initialize WebContainer and build request mapping for WebControllers and WebFilters
Add core servlet and mapping
This core servlet will take charge of all the HTTP requests those mapping to this servlet, so this servlet is the entry for the framework.
NOTE Here the url-patterns for this core servlet mapping are suffixation format; this style is normal and recommend, with this style, you should configure your project on configureClass
Point your project configure class
After point this configure class, EasyWeb framework will know how to initialized itself.
Add build-in filter and mapping
This filter EasyWebFilter is option, if your project need add filters to do authentication, encoding and etc, you can add it in web.xml, then you can use POJO class as Filter just like Controller
Set project class directory
This part is option too, it will be helpful when you in development or your web project class directory is not placed at normal path /WEB-INF/classes/.
Last updated