1. Download the tomcat codeThis article chooses the 9.0 branch. This version of the servlet is still on github starting with javax 2. Directory structure after downloading3. The source code is built using ant (pom is used here instead)<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.apache.tomcat</groupId> <artifactId>tomcat</artifactId> <name>tomcat</name> <version>9.0.19</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.ant</groupId> <artifactId>ant</artifactId> <version>1.10.11</version> </dependency> <dependency> <groupId>wsdl4j</groupId> <artifactId>wsdl4j</artifactId> <version>1.6.3</version> </dependency> <!-- https://mvnrepository.com/artifact/javax.xml.soap/javax.xml.soap-api --> <dependency> <groupId>javax.xml.soap</groupId> <artifactId>javax.xml.soap-api</artifactId> <version>1.4.0</version> </dependency> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-jaxrpc_1.1_spec</artifactId> <version>2.1</version> </dependency> <dependency> <groupId>org.eclipse.jdt</groupId> <artifactId>ecj</artifactId> <version>3.17.0</version> </dependency> <dependency> <groupId>org.easymock</groupId> <artifactId>easymock</artifactId> <version>4.0.2</version> <scope>test</scope> </dependency> <dependency> <groupId>biz.aQute.bnd</groupId> <artifactId>biz.aQute.bndlib</artifactId> <version>5.2.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.unboundid</groupId> <artifactId>unboundid-ldapsdk</artifactId> <version>3.2.0</version> </dependency> </dependencies> </project> Use idea to re-import directly, and temporarily select jdk 1.8 4. Problem Solving4.1 Console garbled characters
September 29, 2021 3:52:17 Garbled Modify the encoding of conf/logging.properties (now defaults to utf-8, basically no changes) Warning: Using [SHA1PRNG] to create a SecureRandom instance for session ID generation took [149] milliseconds Garbled The essential reason for the garbled characters here is that the properties file is garbled. Tomcat uses the system's way of reading configuration files, using URL.openStream, and then using the properties.load method, which will cause garbled characters. Solution Read and rewrite the two internationalization files Localizer and StringManager 4.2 Access 8080 and report an error: jsp and other classes cannot be foundAdd a line of code to the org.apache.catalina.startup.ContextConfig#configureStart method //TODO manually added context.addServletContainerInitializer(new JasperInitializer(), null); 5. Visit localhost:8080over Note that if there are other compilation options, jdk11-16 can directly comment out other errors and solve them normally. This is the end of this article about importing Tomcat source code into idea. For more relevant content about importing Tomcat source code into idea, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: About using Alibaba's iconfont vector icon in Vue
>>: Web page image optimization tools and usage tips sharing
First, the principle of esp8266 publishes message...
Table of contents Preface 1. Routing lazy loading...
Superset is a lightweight self-service BI framewo...
This article example shares the specific code of ...
Prelude We all know that nginx is an excellent re...
Intro Introduces and collects some simple and pra...
Introduction The mysql-utilities toolset is a col...
1. Official website address The official website ...
1. SSH remote management SSH Definition SSH (Secu...
The parameter passed by ${param} will be treated ...
Requirement: When displaying data in a list, ther...
When newbies develop div+css, they need to name t...
Welcome to the previous canvas game series: 《VUE ...
Borrowing Constructors The basic idea of this t...
Preface Generator functions have been in JavaScri...