- This topic has 3 replies, 2 voices, and was last updated 13 years, 4 months ago by support-swapna.
-
AuthorPosts
-
Frank LawlorParticipantThe Ad for ME9 makes a point of Servlet 3.0 support, but I cannot figure out how to enable this.
There is no option on the Web App wizard (I did specify EE 6.0) for servlet 3.
When I try to type @Servlet in a class it does not resolve. The build path does not show the servlet 3 annotations jar.
I see no way to add servlet 3 capabilities to the project.
There is no educational material on this.So how do I say I want Servlet 3.0 support?
— Frank
Frank LawlorParticipantI figured out part of my own problem.
The proper annotation is @WebServletI would still like to understand what enables Servlet 3.0 (is it EE 6.0 selection?).
Frank LawlorParticipantI 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(); } }
support-swapnaModeratorflawlor,
Glad that you got it working. I have escalated your concerns about documentation to the team.
Sorry for the inconvenience caused. -
AuthorPosts