I am trying to test a Google App Engine Java Backend on my localhost. I have the backend running, and I have a servlet written.
However, when I do a post to my backend to url:
http://localhost:8888/MyServlet/
All I get is this:
WARNING: No file found for: /MyServlet/
How do I actually call the backend to start a an instance for me so I can test it locally and do a post?
Servlet:
import java.io.BufferedReader;
import java.io.IOException;
import javax.servlet.http.*;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@SuppressWarnings("serial")
public class MyServlet extends HttpServlet {
public void doPost(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
resp.setContentType("text/plain");
resp.getWriter().println("Hello, world");
}
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>MyBackend</servlet-name>
<servlet-class>com.test.backend.MyServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>test</servlet-name>
<url-pattern>/_ah/start</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>