this is the web.xml
<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns="http://java.sun.com/xml/ns/javaee";
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"; version="2.5">
<servlet>
<servlet-name>TUBlrServlet</servlet-name>
<servlet-class>de.tuberlin.cit.tublr.TUBlrServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TUBlrServlet</servlet-name>
<url-pattern>/tublr</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>tublr.jsp</welcome-file>
</welcome-file-list>
</web-app>


and i made some change in my servlet
package de.tuberlin.cit.tublr;

import java.io.IOException;
import java.util.Map;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.appengine.api.blobstore.BlobKey;
import com.google.appengine.api.blobstore.BlobstoreService;
import com.google.appengine.api.blobstore.BlobstoreServiceFactory;
public class TUBlrServlet extends HttpServlet 
{

private static final long serialVersionUID = 3218329961842485677L;


private BlobstoreService blobstoreService = 
BlobstoreServiceFactory.getBlobstoreService();

public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {

//resp.sendRedirect("/tublr.jsp");
 BlobKey blobKey = new BlobKey(req.getParameter("blob-key"));
        blobstoreService.serve(blobKey, resp);
}

public void doPost(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
 Map<String, BlobKey> blobs = blobstoreService.getUploadedBlobs(req);
    BlobKey blobKey = blobs.get("post_image");

    if (blobKey == null) {
        resp.sendRedirect("/");
    } else {
        resp.sendRedirect("/tublr?blob-key=" + blobKey.getKeyString());
    } 
}
}


Thank you again :-)

Le mercredi 26 juin 2013 22:52:05 UTC+2, Vinny P a écrit :
>
> On Wed, Jun 26, 2013 at 3:28 PM, ben younes raed 
> <raed...@gmail.com<javascript:>
> > wrote:
>
>> Hi 
>>
>> Thank you again for your time :-)
>> I change it but it didnt work ! 
>>  
>>
>  
> Can you post the contents of your (Project Home)/war/WEB-INF/web.xml file? 
> If it doesn't exist, you may need to create it. Here's a description of 
> what it looks like: 
> https://developers.google.com/appengine/docs/java/config/webxml
>  
>  
> -----------------
> -Vinny P
> Technology & Media Advisor
> Chicago, IL
>
> App Engine Code Samples: http://www.learntogoogleit.com
>   
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to