Add java file
Create a demo package in the project src directory, and create a DemoConfig file under the demo package. The content is as follows:
package demo;
import com.jfinal.config.* ;
public class DemoConfig extends JFinalConfig {
public void configConstant(Constants me)
{ me.setDevMode(true);
}
public void configRoute(Routes me)
{ me .add("/hello",
HelloController.class);
}
public void configPlugin(Plugins me) {}
public void configInterceptor(Interceptors me) {}
public void configHandler (Handlers me) {}
import com.jfinal.config.* ;
public class DemoConfig extends JFinalConfig {
public void configConstant(Constants me)
{ me.setDevMode(true);
}
public void configRoute(Routes me)
{ me .add("/hello",
HelloController.class);
}
public void configPlugin(Plugins me) {}
public void configInterceptor(Interceptors me) {}
public void configHandler (Handlers me) {}
Note: The package where the DemoConfig.java file is located and its file name must be consistent with the configuration in the param-value tag in web.xml (in this example Configured as demo.DemoConfig).
Create the HelloController class file under the demo package with the following content:
package demo;
import com.jfinal.config.*;
public class DemoConfig extends JFinalConfig {
public void configConstant(Constants me)
{ me.setDevMode(true);
}
public void configRoute(Routes me)
{ me.add( "/hello",
HelloController.class);
}
public void configPlugin(Plugins me) {}
public void configInterceptor(Interceptors me) {}
public void configHandler(Handlers me ) {}
import com.jfinal.config.*;
public class DemoConfig extends JFinalConfig {
public void configConstant(Constants me)
{ me.setDevMode(true);
}
public void configRoute(Routes me)
{ me.add( "/hello",
HelloController.class);
}
public void configPlugin(Plugins me) {}
public void configInterceptor(Interceptors me) {}
public void configHandler(Handlers me ) {}