小编Fez*_*eel的帖子

通过使用blobstore,Gif(动画)在Appengine上有效,但在具有相同代码的localhost上无效

我正在使用Blobstore存储GIF图像文件,然后将其呈现为HTML <img>标签。当我部署到App Engine的实时实例时,动画GIF可以正常工作,但是当我部署到本地devserver时,GIF不再是动画。

Math.random()在由url组成的图片标签中添加了功能,但在本地主机上仍然无法使用。

我希望动画GIF文件可以在本地主机上工作,但是我的控制台向我显示缺少ImageIO插件并且找不到图像阅读器,并且GIF在本地主机上不显示动画。

是一个演示该问题的示例回购。大多数逻辑都在FormHandlerServlet该类中:

@WebServlet("/my-form-handler")
public class FormHandlerServlet extends HttpServlet {

  @Override
  public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {

    // Get the message entered by the user.
    String message = request.getParameter("message");

    // Get the URL of the image that the user uploaded to Blobstore.
    String imageUrl = getUploadedFileUrl(request, "image");

    // Output some HTML that shows the data the user entered.
    // A real codebase would probably store these in Datastore. …
Run Code Online (Sandbox Code Playgroud)

java google-app-engine localhost blobstore appengine-maven-plugin

7
推荐指数
1
解决办法
131
查看次数