且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Tomcat和解压缩的文件

更新时间:2023-10-26 23:33:22

WAR文件可能在服务器上的某处",但是tomcat可能已配置为在部署时不爆炸" WAR文件,而只是为资源直接从战争中撤出.这可能就是为什么您的网站可以运行"但找不到实际的.css文件的原因,.css文件不在文件系统上,但仍包含在WAR中.

The WAR file is likely "somewhere" on the server, but tomcat may have been configured to not "explode" the WAR files on deploy, and simply serve the resources directly out of the WAR. That may be why your web site "works" but you can not find the actual .css files, the .css files are not there on the file system but still contained in the WAR.

对于#2,预编译JSP,由于某种原因,这仍然是跳火成竹"的过程,只是半自动化的.

As for #2, pre-compiling JSPs, for some reason this is still a "jump through flaming hoops" process that is only semi-automated.

在部署之前预编译JSP需要将JSP文件转换为Java源文件,然后编译该文件,然后在最终的Web应用程序中将该结果类映射为servlet,然后最终从Web应用程序中删除该JSP文件.网络应用.

Pre-compiling JSPs before deployment entails the converting of the JSP file to a Java source file, compiling that file, and then mapping that resulting class as a servlet in the final web app, and then finally removing the JSP file from the web app.

有一个 Tomcat页面讨论了该过程,但仅提供了部分解决方案(从自动化角度出发).

There is a Tomcat Page that discusses the process, but only offers part of the solution (from an automation stand point).

当然,预编译不流行的原因之一是,预编译的JSP不能跨容器移植,也不一定是同一容器的版本.因此,这是一个值得注意的问题.

Of course, one reason pre-compiling is not popular is that pre-compiled JSPs are not portable across containers, nor necessarily versions of the same container. So, that's a notable issue.