java - Google App Engine - Blob Store Service with a Dispatcher Servlet

I have a central dispatcher servlet that has a servlet mapping of :

<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>

When i try to use the blob store service's createUploadUrl("/uploadComplete") it maps to a URL for e.g '/_ah/upload/agp0d2VldG15cGljchsLEhVfX0Jsb2JVcGxvYWRTZXNzaW9uX18YEgw'.

Before the Blob store service can handle the upload and redirect to /uploadComplete; my dispatcher servlet gets called and i am therefore not being able to upload anything.

Is there a servlet/ filter that i can map to /_ah/upload/* in my web.xml ?

How do i avoid the dispatcher servlet from getting called before the Blob store service can do its thing?

3 Answers

  1. Loren- Reply

    2019-11-14

    Have you tried mapping your uploadComplete servlet?
    I would add a mapping like:

     <servlet>
      <servlet-name>UploadComplete</servlet-name>
      <servlet-class>com.Rahul.test.UploadComplete</servlet-class>
     </servlet>
     <servlet-mapping>
      <servlet-name>UploadComplete</servlet-name>
      <url-pattern>/uploadComplete</url-pattern>
     </servlet-mapping>
    

    just before your mapping

    <servlet-mapping>
     <servlet-name>dispatcher</servlet-name>
     <url-pattern>/</url-pattern>
    </servlet-mapping>
    
  2. Lori- Reply

    2019-11-14

    URLs under /_ah/ are reserved by App Engine, and will be directed to the appropriate subsystem regardless of what your config says. What makes you think requests are being sent to your handler instead of the blobstore one?

  3. Lorin- Reply

    2019-11-14

    On further investigation, i have determined that the handler is getting called, however the request is not getting rewritten to "/uploadComplete" on the DevAppServer.

    The blobs get uploaded to the blob store, but the forwarded request from the Blobstore service reads /_ah/upload/...* which is an invalid url as far as my end of the web application is concerned.

    Thank you for all your answers thus far.

Leave a Reply

Your email address will not be published. Required fields are marked *

You can use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>