Deploy jFinal under Tomcat

1. Check the web.xml configuration. When deploying under tomcat, you need to check whether the web.xml exists and make sure the configuration is correct. The configuration format is as follows.

<?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>

Note: The param-value configuration depends on the package name and class name of the specific XxxConfig of your project. Pay attention to modifications. Other configurations can be copied intact.

2. Idea configures tomcat and creates the war package.

(1) Project construction, Modules add Web

(2) There is a lack of packages when building the project. jFinal is different from the maven project and needs to add local packages.

(3) Project construction, configure Facets

(4) Project construction and configuration artifacts

 (5) Configure tomcat

(6) Start the project and create the war package.

Guess you like

Origin blog.csdn.net/qq_42405688/article/details/132839569
Recommended