Tomcat 8
2024-10-16 08:58:00
JDTCompiler.java
/**
* Compile the jsp file from the current engine context. As an side- effect,
* tag files that are referenced by this page are also compiled.
* 编译 jsp 文件,对应生成 java 文件和 class 文件
* @param compileClass
* If true, generate both .java and .class file If false,
* generate only .java file
*/
void org.apache.jasper.compiler.Compiler.compile(boolean compileClass)
/**
* Compile the jsp file into equivalent servlet in .java file
* 编译 jsp 文件,生成相应的 servlet 的 java文件
* @return a smap for the current JSP page, if one is generated, null
* otherwise
*/
String[] org.apache.jasper.compiler.Compiler.generateJava()
/**
* Compile the servlet from .java file to .class file
* 将 servlet 的 java 文件编译成 class 文件
*/
void org.apache.jasper.compiler.JDTCompiler.generateClass(String[] smap)
JspCompilationContext.java
/**
* Full path name of the Java file into which the servlet is being
* generated.
* jsp 文件生成对应的 servlet java文件的全路径
*/
public String getServletJavaFileName() {
if (servletJavaFileName == null) {
servletJavaFileName = getOutputDir() + getServletClassName() + ".java";
}
return servletJavaFileName;
}
SmapUtil.java 写出 jsp 文件对应的 servlet 的 class 文件
public static void installSmap(String[] smap)
throws IOException {
if (smap == null) {
return;
} for (int i = 0; i < smap.length; i += 2) {
File outServlet = new File(smap[i]);
SDEInstaller.install(outServlet,
smap[i+1].getBytes(StandardCharsets.ISO_8859_1));
}
}
参考:
http://www.cnblogs.com/mapeng-cnblogs/p/4226005.html
https://my.oschina.net/heroShane/blog/198450
https://www.ibm.com/developerworks/cn/java/j-lo-servlet/
最新文章
- 解决安装rpm包依赖关系的烦恼 - yum工具介绍及本地源配置方法
- 1.Powershell认识
- pundit
- easyui textarea回车导致datagrid 数据无法展示的问题
- java web项目中 获取resource路径下的文件路径
- delphi 10 seattle 中 解决IOS 9 限制使用HTTP 服务问题
- 第42讲:Scala中泛型类、泛型函数、泛型在Spark中的广泛应用
- Program D--贪心-区间覆盖
- [SQL]向3个表插入数据的存储过程 和 C# 代码
- 关于AfterLogic WebMail 的.net版无法上传控件的解决办法
- ISO7816 传输协议 T0 T1
- python3使用smtplib发电子邮件
- xib storyboard
- 2017/11/25 2D变换
- Java的四种引用——强引用、软引用、弱引用、虚引用
- CNN大战验证码
- Jz2440 环境安装
- hadoop中的Jobhistory历史服务器
- 我也学习JAVA多线程-join
- JS获值