1、创建一个maven web项目。
2、添加引用包
<
dependency
>
< groupId >com.jfinal </ groupId >
< artifactId >jfinal </ artifactId >
< version >2.2-SNAPSHOT </ version >
</ dependency >
< dependency >
< groupId >com.jfinal </ groupId >
< artifactId >jetty-server </ artifactId >
< version >8.1.8 </ version >
</ dependency >
< groupId >com.jfinal </ groupId >
< artifactId >jfinal </ artifactId >
< version >2.2-SNAPSHOT </ version >
</ dependency >
< dependency >
< groupId >com.jfinal </ groupId >
< artifactId >jetty-server </ artifactId >
< version >8.1.8 </ version >
</ dependency >
3、添加项目启动类
package demo;
import com.jfinal.core.JFinal;
public class Runner {
public static void main(String[] args) {
JFinal.start("src/main/webapp", 80, "/", 0);
}
}
import com.jfinal.core.JFinal;
public class Runner {
public static void main(String[] args) {
JFinal.start("src/main/webapp", 80, "/", 0);
}
}
4、启动项目