简体   繁体   English

tomcat6应用程序部署错误

[英]tomcat6 application deployment error

I am new to tomcat and servlets and am trying to deploy my first web application in tomcat and the index.jsp page is showing up blank. 我是tomcat和servlet的新手,正在尝试在tomcat中部署我的第一个Web应用程序,并且index.jsp页显示为空白。

It works fine in eclipse. 在日食中工作正常。 I have the web.xml for the application setup to have the index.jsp as the default page. 我有用于应用程序设置的web.xml,将index.jsp作为默认页面。 I am able to run the application and debug it in eclipse but when I export it as a WAR file and deploy it in tomcat and try to access it through a regular browser I get a blank page. 我能够运行该应用程序并在eclipse中对其进行调试,但是当我将其导出为WAR文件并将其部署到tomcat中并尝试通过常规浏览器访问它时,我得到了一个空白页。

What am I missing here? 我在这里想念什么? Any help is greatly appreciated. 任何帮助是极大的赞赏。

Thanks, - Vas 谢谢,-Vas

If you ever get a blank page, the most important information you (and we) need are: 如果您得到空白页,则您(以及我们)需要的最重要的信息是:

  1. The request URL. 请求网址。
  2. The already sent data -if any- (webbrowser > View Source ). 已发送的数据-如果有的话-(网络浏览器> 查看源代码 )。
  3. The response headers (Firebug? Webdeveloper Toolbar?). 响应标头(Firebug?Webdeveloper工具栏?)。
  4. The server logs (stdout, stderr, webapp). 服务器日志(stdout,stderr,webapp)。

This usually indicate a wrong URL (to be proven by 1), or an exception halfway a JSP page (to be proven by 2 and 4), or an internal server error without an error page (to be proven by 3 and 4). 这通常表示错误的URL(由1证明),JSP页面中途的异常(由2和4证明)或没有错误页面的内部服务器错误(由3和4证明)。

You need to configure your server.xml file and declare a context for your web application. 您需要配置server.xml文件并为Web应用程序声明一个上下文。 You can find the documentation here: http://tomcat.apache.org/tomcat-6.0-doc/config/context.html 您可以在此处找到文档: http : //tomcat.apache.org/tomcat-6.0-doc/config/context.html

But a blank page is kind of weird, because I think if your web application wasn't deploy correctly, you will get a Http 404 error. 但是空白页有点奇怪,因为我认为如果您的Web应用程序部署不正确,则会出现Http 404错误。

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

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