I finally got a simple example to work.
Here is what I learned.
Since ME9 says it supports servlet 3, I expected the MyEclipse Tomcat server (v6) to work, but it doesn’t seem to.
I installed tomcat 7, which worked.
The are a lot of posts on the web about servlet 3, but I guess they don’t match what actually got shipped.
It would be nice to at least have a reference to documetation of what actually works in the ME9 support.
I had to inherit from HttpServlet (some posts say this was no longer necessary).
The @GET, @PUT etc. annotations don’t seem to work, although they are defined.
This worked:
@WebServlet(urlPatterns={"/MyApp"})
public class MyServlet extends HttpServlet {
@Override
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
PrintWriter out = res.getWriter();
out.write("<h2>Hello GET</h2>");
out.close();
}
}