0

以下代码段在 IDE 中以及当我单击部署应用程序时生成错误。

        <form  action="<%= blobstoreService.createUploadUrl("/upload") %>" method="post" enctype="multipart/form-data">
          <input type="file" name="myFile"/>
          <input type="submit" value="submit"/>

错误:

error: cannot find symbol
[javac]       out.print( blobstoreService.createUploadUrl("/upload") );
[javac]                  ^
[javac]   symbol:   variable blobstoreService
[javac]   location: class UploadTester_jsp
[javac] 1 error

我需要添加什么?为什么我会收到此错误?

4

1 回答 1

1

您必须声明然后初始化变量blobstoreService

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

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

以上直接来自文档

于 2012-07-30T11:01:15.750 回答