简体   繁体   English

.jsp页面不适用于Google App Engine

[英].jsp page not working with Google App Engine

I have built a path from Eclipse to the home directory of the jdk. 我已经建立了从Eclipse到jdk主目录的路径。 As you can see here: 如您所见: http://s18.postimage.org/9sj7vfx21/picture.png

Below is my index page that is first loaded when I start my server on localhost. 以下是我在本地主机上启动服务器时首先加载的索引页面。

The jsp file is not displaying properly as it lets the user see the actual code. jsp文件无法正确显示,因为它会让用户看到实际的代码。 Is there something else I need to do? 还有什么我需要做的吗?

// index.jsp //
<%@ page language="java" %>
<%@ page import="javax.servlet.http.HttpServlet" %> 
<html>
<body>
    <h1>Welcome! </h1>
    <a href="http://localhost:8888/viewfiles" />View Files</a>
    <a href="http://localhost:8888/upload.jsp" />Upload Files</a>
    <p>
       Today's date: <%= (new java.util.Date()).toLocaleString()%>
    </p>
</body>
</html>

A couple of things to check: 需要检查的几件事:

  1. JDK 1.7 is experimental in GAE, so you need to make sure that things are configured for it: https://developers.google.com/appengine/docs/java/java7 You might want to consider sticking with 1.6 for now, anyway. JDK 1.7在GAE中是试验性的,因此您需要确保已对其进行了配置: https : //developers.google.com/appengine/docs/java/java7无论如何,您可能现在应该考虑使用1.6。
  2. You probably need to check your web.xml, as that is the place where the application is really configured. 您可能需要检查web.xml,因为这是真正配置应用程序的地方。 See: https://developers.google.com/appengine/docs/java/config/webxml 请参阅: https : //developers.google.com/appengine/docs/java/config/webxml
  3. This is probably something that you are going to fix, but of course localhost URLs aren't going to work as one might expect when you actually deploy the app. 这可能是您要解决的问题,但是,当实际部署应用程序时,当然,本地主机URL并不会像人们期望的那样起作用。

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

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