1.下载网址
Index of /tomcat/tomcat-8/v8.5.75
2.下载源代码:
3.解压?源码,如下目录
4.Idea?开发源码目录
?
5.添加pom.xml文件
右键,添加 pom.xml?文件,如下:
导入pom.xml?内容
<?xml version="1.0" encoding="UTF-8"?>
<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>Tomcat8.5.57</artifactId>
<name>Tomcat8.5.57</name>
<version>8.5.57</version>
<build>
<finalName>Tomcat8.5.57</finalName>
<sourceDirectory>java</sourceDirectory>
<!--<testSourceDirectory>test</testSourceDirectory>-->
<resources>
<resource>
<directory>java</directory>
</resource>
</resources>
<!--<testResources>-->
<!--<testResource>-->
<!--<directory>test</directory>-->
<!--</testResource>-->
<!--</testResources>-->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxrpc</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.jdt.core.compiler</groupId>
<artifactId>ecj</artifactId>
<version>4.5.1</version>
</dependency>
</dependencies>
</project>
6.pom.xml文件,加载要maven中。
7.编辑代码
7.启动tomcat?
? ? ? ? 找到tomcat?入口函数。
?
8.解决乱码
.修改org.apache.jasper.compiler.Localize#getMessage(java.lang.String)方法
?.修改?org.apache.tomcat.util.res.StringManager??
public String getString(String key)
?重启服务后刷新:
8.解决无法编译jsp问题。
? ? ? ? 找到?org.apache.catalina.startup.ContextConfig?中的?
configureStart 函数,添加如下代码
context.addServletContainerInitializer(new JasperInitializer(),null);
重启后,刷新,成功:
|