Tomcat 下部署 jFinal

1、检查web.xml 配置,在 tomcat 下部署需要检查 web.xml 是否存在,并且要确保配置正确,配置格式如下。

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
  <filter>
    <filter-name>jfinal</filter-name>
    <filter-class>com.jfinal.core.JFinalFilter</filter-class>
    <init-param>
      <param-name>configClass</param-name>
      <param-value>com.atom.config.WebConfig</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>jfinal</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
</web-app>

注意:其中的 param-value 配置取决于你项目的具体 XxxConfig 的包名与类名,注意修改,其它配置可原封不动进行复制。

2、idea配置tomcat,并打出war包。

(1)项目构建,Modules添加Web

(2) 项目构建时缺少包,jFinal区别于maven项目,需要加本地的包

(3)项目构建,配置Facets

(4)项目构建,配置artifacts

 (5)配置tomcat

(6)启动项目,打出war包。

猜你喜欢

转载自blog.csdn.net/qq_42405688/article/details/132839569