简体   繁体   English

Google Blobstore App Engine教程

[英]Google Blobstore App Engine tutorial

Update see below 更新见下

I'm trying to build this blobstore app engine sample from this google tutorial: 我正在尝试通过以下Google教程构建此Blobstore应用程序引擎示例:

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

This is what I have. 这就是我所拥有的。 I can select a file to upload. 我可以选择要上传的文件。

http://instantedituploader.appspot.com/ http://instantedituploader.appspot.com/

When I hit submit I get this error: 当我点击提交时,我得到这个错误:

    Error: Not Found

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

I'm fairly certain I'm missing: 我可以肯定我很想念:

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

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

I took it out because I couldn't figure out how to include that in the index.html. 我将其删除是因为我不知道如何将其包括在index.html中。 The tutorial uses a jsp file to include the above and the html for the upload form/submit. 本教程使用一个jsp文件来包含以上内容和用于上传表单/提交的html。 How do I do this? 我该怎么做呢?

UPDATE---------------------- 更新----------------------

Ok I switched the index.jsp to my welcome file. 好的,我将index.jsp切换到了我的欢迎文件。 Now I get a 500 Server Error this is what shows up in the app engine console and I also get a /favicon.ico error too. 现在,我收到了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

The files in the example are Java Server Pages. 示例中的文件是Java Server Pages。 See the docs on how to use JSPs with GAE . 请参阅有关如何在GAE中使用JSP的文档。

You should rename index.html to index.jsp and set it as a welcome file in your web.xml (welcome page is served when user invokes the root / ): 您应该将index.html重命名为index.jsp并将其设置为web.xml的欢迎文件(当用户调用root /时将显示欢迎页面):

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

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

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