jfinal2.2在idea用main运行注意事项

发布时间 2023-12-04 12:03:13作者: 猝死的路上

1.用new -> project from exists source 方式,用 maven 方式导入

2.jfinal2.2使用 8.1.8的jetty server,pom使用 compile

<dependency>
  <groupId>com.jfinal</groupId>
  <artifactId>jetty-server</artifactId>
  <version>8.1.8</version>
  <scope>compile</scope>
</dependency>

<!-- 下面的依赖仅在使用 JSP 时才需要 -->
<dependency>
  <groupId>org.eclipse.jetty</groupId>
  <artifactId>jetty-jsp</artifactId>
  <version>9.2.26.v20180806</version>
  <scope>compile</scope>
</dependency>

3.main方法

public static void main(String[] args) {
  JFinal.start("src/main/webapp", 8080, "/", 5);
}