This thread has been locked & this forum has been archived.
Please post new topics to General Development
Author Message
flawlor
Veteran Member
Veteran Member


Joined: Jul 01, 2006
Posts: 137

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
 
 View user's profile Send private message  
Reply with quote Back to top
flawlor
Veteran Member
Veteran Member


Joined: Jul 01, 2006
Posts: 137

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?).
 
 View user's profile Send private message  
Reply with quote Back to top
flawlor
Veteran Member
Veteran Member


Joined: Jul 01, 2006
Posts: 137

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:

Code:
@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();
      
   }
}
 
 View user's profile Send private message  
Reply with quote Back to top
support-swapna



Joined: Nov 11, 2010
Posts: 2696

flawlor,

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

_________________
Swapna
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
All times are GMT - 6 Hours
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
® 2014 - Genuitec, LLC.