tomcat and extracted files

一个人想着一个人 提交于 2019-12-12 03:32:39

问题


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

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/

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

  1. where are they?!

  2. 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?


回答1:


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.

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

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.

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

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.



来源:https://stackoverflow.com/questions/14945820/tomcat-and-extracted-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!