Tomcat和解压缩的文件 [英] tomcat and extracted files

查看:69
本文介绍了Tomcat和解压缩的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将 ubuntu 与打包的 tomcate7 一起使用.我使用 .war 文件上传了网站.网络工作正常.

I am using ubuntu with packaged tomcate7 . I used .war file to upload the website. the web is working fine.

这不是我的网站,但是在那儿

This is not my website but its there:

:/var/lib/tomcat7/webapps/ROOT$ ls
index.html  META-INF

我在以下位置找到我的站点文件(.war中的文件)

I find my site files (those in .war) at

/var/cache/tomcat7/Catalina/localhost/_/org/apache/jsp/

/var/cache/tomcat7/Catalina/localhost/_/WEB-INF/classes/

在系统范围内找不到我的任何.css或.js文件像 find/-name'* .css'-ls

I do not find any of my .css or .js files with a system wide search like find / -name '*.css' -ls

  1. 它们在哪里?!

  1. where are they?!

是否有一种简单的方法可以只给tomcat .class文件或删除.jsp .java文件(例如,如果我不想提供真实的源代码,而只给出.class)JSP预编译.在构建期间,某些工具(jspc)很难.任何简单的操作?

Is there an easy way to just give tomcat the .class files or delete the .jsp .java files (for example if I don't want to give the real source but only .class) JSP precompilation. During build-time some tool (jspc) is difficult. any easy walk through?

推荐答案

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.

这篇关于Tomcat和解压缩的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆