gpt4 book ai didi

java - Google Blobstore App Engine 教程

转载 作者:行者123 更新时间:2023-12-01 14:06:16 29 4
gpt4 key购买 nike

更新见下文

我正在尝试根据此 Google 教程构建此 blobstore 应用程序引擎示例:

https://developers.google.com/appengine/docs/java/blobstore/#Uploading_a_Blob

这就是我所拥有的。我可以选择要上传的文件。

http://instantedituploader.appspot.com/

当我点击提交时,我收到此错误:

    Error: Not Found

The requested URL /%3C%=%20blobstoreService.createUploadUrl(?foo=&myFile=sprayerpic.jpg was not found on this server.

我相当确定我失踪了:

<%@ page import="com.google.appengine.api.blobstore.BlobstoreServiceFactory" %>
<%@ page import="com.google.appengine.api.blobstore.BlobstoreService" %>

<%
BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
%>

我把它拿出来是因为我不知道如何将其包含在index.html中。本教程使用 jsp 文件包含上述内容以及用于上传表单/提交的 html。我该怎么做?

更新----------------------

好的,我将index.jsp 切换到了我的欢迎文件。现在,我收到了 500 服务器错误,这是应用程序引擎控制台中显示的内容,我也收到了/favicon.ico 错误。

013-09-18 08:33:08.601 / 500 3477ms 0kb Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.4 (KHTML, like Gecko) Ubuntu/12.10 Chromium/22.0.1229.94 Chrome/22.0.1229.94 Safari/537.4
W 2013-09-18 08:33:08.412 EXCEPTION java.lang.ClassNotFoundException: Serve at com.google.appengine.runtime.Request.process-cb1588546d641fbb(Request.java) at java.lang.Class
E 2013-09-18 08:33:08.414 javax.servlet.ServletContext log: unavailable javax.servlet.UnavailableException: Serve at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:79)
W 2013-09-18 08:33:08.419 EXCEPTION java.lang.ClassNotFoundException: Upload at com.google.appengine.runtime.Request.process-cb1588546d641fbb(Request.java) at java.lang.Clas
E 2013-09-18 08:33:08.420 javax.servlet.ServletContext log: unavailable javax.servlet.UnavailableException: Upload at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:79)
W 2013-09-18 08:33:08.591 Failed startup of context com.google.apphosting.utils.jetty.RuntimeAppEngineWebAppContext@d206ca{/,/base/data/home/apps/s~instantedituploader/1.370311
C 2013-09-18 08:33:08.597 Uncaught exception from servlet javax.servlet.UnavailableException: Initialization failed. at com.google.apphosting.runtime.jetty.AppVersionHandlerMa
I 2013-09-18 08:33:08.600 This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This requ

最佳答案

示例中的文件是 Java Server Pages。请参阅有关如何 use JSPs with GAE 的文档.

您应该将 index.html 重命名为 index.jsp 并将其设置为 web.xml 中的欢迎文件(欢迎页面为当用户调用根 / 时提供服务:

<welcome-file-list>
<welcome-file>path/to/index.jsp</welcome-file>
</welcome-file-list>

关于java - Google Blobstore App Engine 教程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18875782/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com