views:

458

answers:

3

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?

A: 

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>
systempuntoout
+1  A: 

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?

Nick Johnson
A: 

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.

Rahul