java 我们必须将 .class 文件放在 Tomcat 目录中的位置
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3405121/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where we have to put the .class file in Tomcat Directory
提问by BalusC
Where do I have to put my *.classfile in Tomcat Directory?
我必须将我的*.class文件放在 Tomcat 目录中的什么位置?
In my Java-Complete Reference book, they told to put it in C:\Program Files\Apache Tomcat 4.0\webapps\examples\WEB-INF\classes. But now i'm using Tomcat 7.0. There is no folder exists with the name "examples" in webapps.
在我的 Java-Complete 参考书中,他们告诉将它放在C:\Program Files\Apache Tomcat 4.0\webapps\examples\WEB-INF\classes. 但现在我使用的是 Tomcat 7.0。webapps 中不存在名为“examples”的文件夹。
How can I fix this? Can you tell me links that will illustrate Servlets from beginning?
我怎样才能解决这个问题?你能告诉我从头开始说明 Servlet 的链接吗?
回答by BalusC
Just create one yourself. Any folder which you create in Tomcat/webappswill become a standalone webapplication. You don't even need to name it explicitly /examples. You can even name it /beer. You then just have to change the URL from http://localhost:8080/examplesto http://localhost:8080/beer.
自己创造一个。您在其中创建的任何文件夹都Tomcat/webapps将成为独立的 Web 应用程序。您甚至不需要明确命名它/examples。你甚至可以命名它/beer。然后,您只需将 URL 从http://localhost:8080/examples更改为http://localhost:8080/beer。
That said, I think it's better to look for a more recent book than the one mentioning Tomcat 4.0 which is already over a decade old. There might be more old fashioned advices/practices in the book which really can't be done anymore nowadays (for example, cough, scriptlets). Those books are more recent (in order from newest to older):
也就是说,我认为寻找一本更新的书比提到已经有十多年历史的 Tomcat 4.0 的书更好。书中可能有更多老式的建议/实践,现在真的不能再做了(例如,咳嗽,脚本)。这些书是较新的(按从新到旧的顺序):
To learn JSP/Servlets online, I can recommend the tutorials and ebook at coreservlets.com:
要在线学习 JSP/Servlets,我可以推荐 coreservlets.com 上的教程和电子书:
- Beginning and intermediate JSP/Servlet tutorials
- Advanced JSP/Servlet tutorials
- Core Servlets and JSP ebook

