我的网页无法呈现
我正在开发一个评估系统。我已经在 eclipse 中设置了一个动态 Web 项目(使用 apache tomcat),并且在本地主机上访问它时能够成功访问和查看项目。但是,我只是将其部署在网上(通过战争),当我访问该网站时,网页不会呈现。显示的只是代码。我分别在 html 注释和元标记中设置文档类型和内容类型。为什么会发生这种情况?截至目前,该站点已部署在(已删除)。
I am developing a evaluation system. I have set up a dynamic web project in eclipse (with apache tomcat) and have been able to successfully access and view project when accessing it on my local host. However, I just deployed it online (via a war) and when I access the site the web pages do not render. All that is shown is the code. I set the doc type and the content type in an html comment and a meta tag respectively. Why could this be happening? the site is deployed at (REMOVED) as of right now.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Firebug 是一个检查 HTTP 请求/响应的好工具。检查网络选项卡。以下是当我访问您在问题中链接的网站时收到的 HTTP 响应标头:
注意内容类型。错了,应该是
text/html
。如果您使用 JSP 来提供响应,那么您的 JSP 顶部可能有这样的内容,您应该删除它(它已经默认为
text/html
),或者如果无效,请将其替换为If仍然无效,请联系您的托管支持人员。
Firebug is a great tool to check the HTTP request/responses. Check the Net tab. Here are the HTTP response headers which I get when I access the site which you linked in the question:
Note the content type. It's wrong, it should be
text/html
. If you was using JSP to serve the response, then you probably had like this in top of your JSPyou should remove this (it already defaults to
text/html
) or if in vain, replace this byIf still in vain, contact the support of your hosting.