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
1 Introduction In the article "Start Postgre...
In the previous article, I wrote a cross-table up...
Using the image service deployed by docker stack,...
Sometimes some docker containers exit after a per...
1. What is the hyperlink icon specification ?<...
This article shares the specific code of JavaScri...
Preface: Recently I am going to team up with my p...
This article mainly introduces the Mysql backup m...
This article refers to the work of 51CTO blog aut...
This article mainly introduces an example of Vue ...
So which one of these formats, GIF, PNG, and JPG,...
If someone asked you whether running EXPLAIN on a...
question: Recently, garbled data appeared when de...
1. Install a virtual machine (physical machine) Y...
Table of contents Virtual DOM What is virtual dom...