Java 如何在不使用eclipse的情况下编译和运行jsp文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19291681/
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
How to compile and run jsp file without using eclipse
提问by Kranti123
I dont have eclipse, I want to compile jsp files and servlets. How to compile and run jsp file without using eclipse.
我没有eclipse,我想编译jsp文件和servlet。如何在不使用eclipse的情况下编译和运行jsp文件。
回答by ASD
For compiling a JSP file on command prompt, Refer: http://docs.oracle.com/cd/E19146-01/821-0790/abxcc/index.html
在命令提示符下编译 JSP 文件,请参考:http: //docs.oracle.com/cd/E19146-01/821-0790/abxcc/index.html
For running you will need a Webserver.
要运行,您将需要一个 Web 服务器。
回答by Alex Theedom
You could package the web application into a WAR file then deploy it to the server and then pre-compile all the JSPs. See this article on pre-compilation of JSPs. http://javapapers.com/jsp/how-to-pre-compile-jsp/. Once they are compiled you can search for the directory to which that are compiled. In Tomcat look for the Catalina directory. For other vendors you will need to check the documentation for the location of the compiled JSPs.
您可以将 Web 应用程序打包成 WAR 文件,然后将其部署到服务器,然后预编译所有 JSP。请参阅有关 JSP 预编译的这篇文章。http://javapapers.com/jsp/how-to-pre-compile-jsp/。编译完成后,您可以搜索编译到的目录。在 Tomcat 中查找 Catalina 目录。对于其他供应商,您需要检查已编译 JSP 位置的文档。