facebook

Servlet 3.0 Support

  1. MyEclipse Archived
  2.  > 
  3. Web Development (HTML, CSS, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #317723 Reply

    Frank Lawlor
    Participant

    The 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

    #317727 Reply

    Frank Lawlor
    Participant

    I figured out part of my own problem.
    The proper annotation is @WebServlet

    I would still like to understand what enables Servlet 3.0 (is it EE 6.0 selection?).

    #317728 Reply

    Frank Lawlor
    Participant

    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();
            
        }
    }
    #317762 Reply

    support-swapna
    Moderator

    flawlor,

    Glad that you got it working. I have escalated your concerns about documentation to the team.
    Sorry for the inconvenience caused.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Servlet 3.0 Support

You must be logged in to post in the forum log in