简体   繁体   English

Eclipse存储Tomcat的servlet文件在哪里?

[英]Where does Eclipse store generated servlet files for Tomcat?

I'm using Eclipse Java EE IDE and launch Tomcat from the Server's tab on Eclipse. 我正在使用Eclipse Java EE IDE并从Eclipse上的Server选项卡启动Tomcat。

Where does Eclipse store generated servlet .java files for JSP files? Eclipse存储在哪里为JSP文件生成servlet .java文件? I've checked the Tomcat installation directory, but nothing there. 我已经检查了Tomcat安装目录,但没有。

Thanks. 谢谢。

Doubleclick the server entry in Servers view and check the path represented by Server path . 双击Servers视图中的服务器条目,并检查Server path表示的路径 Explore in there from inside the workspace directory. 从工作区目录中进行探索。 The generated classes are there. 生成的类在那里。

替代文字


If you choose the 2nd option Use Tomcat installation , then it will be available Tomcat's /work folder, there where you expected it to be. 如果您选择第二个选项使用Tomcat安装 ,那么它将是Tomcat的/work文件夹,您可以在那里预期它。

go to your application work space directory(not eclipse installation directory) in windows explorer(not in eclipse IDE explorer). 转到Windows资源管理器中的应用程序工作空间目录(不是eclipse安装目录)(不在eclipse IDE资源管理器中)。

in my laptop it is d:/applicationdata/j2ee then follow the path as: 在我的笔记本电脑中它是d:/ applicationdata / j2ee然后按照路径:

work space directory(in my case j2ee)/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work/catalina/localhost 工作空间目录(在我的情况下是j2ee)/。metadata / .plugins / org.eclipse.wst.server.core / tmp0 / work / catalina / localhost

here u will find your application 在这里你会找到你的申请

Eclipse doesn't generate servlet files for JSP files. Eclipse不会为JSP文件生成servlet文件。 Validation happens directly on JSP syntax. 验证直接在JSP语法上进行。 When a JSP is deployed to an app server like Tomcat, the server may choose to generate servlet files to disk, but that is not required. 将JSP部署到像Tomcat这样的应用服务器时,服务器可能会选择将servlet文件生成到磁盘,但这不是必需的。 The generation and compilation can happen in memory or the app server may even compile JSP files directly to bytecode. 生成和编译可以在内存中进行,或者应用服务器甚至可以将JSP文件直接编译为字节码。

I don't know specifically about Tomcat, but if it does generate servlet files to disk, the temporary directory containing these files will be somewhere under your Tomcat install. 我不是特别了解Tomcat,但如果它确实生成了servlet文件到磁盘,那么包含这些文件的临时目录将位于Tomcat安装的某个位置。

/home/waheguru/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work/Catalina/localhost/jspnotes/org/apache/jsp /home/waheguru/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work/Catalina/localhost/jspnotes/org/apache/jsp

localhost or your website name, project name is jspnotes, whatever your project. localhost或您的网站名称,项目名称是jspnotes,无论您的项目是什么。

This path is shown in Linux Mint. 此路径显示在Linux Mint中。

Check META-INF\\context.xml file from your work space. 检查工作区中的META-INF \\ context.xml文件。 There will be path metioned like below 会有如下所示的路径

workDir="C:\\apache-tomcat-7.0.39\\work" 的workDir = “C:\\ Apache的Tomcat的7.0.39 \\工作”

In above path you will find the package structure of your project and in it there will be both *_jsp.java and *_jsp.class 在上面的路径中,您将找到项目的包结构,其中将包含* _jsp.java和* _jsp.class

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM