MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
flawlor
Post subject: Servlet 3.0 Support  PostPosted: Jun 23, 2011 - 03:47 PM
Veteran Member
Veteran Member


Joined: Jul 01, 2006
Posts: 126

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
Post subject: RE: Servlet 3.0 Support  PostPosted: Jun 23, 2011 - 04:53 PM
Veteran Member
Veteran Member


Joined: Jul 01, 2006
Posts: 126

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
Post subject: RE: Servlet 3.0 Support  PostPosted: Jun 23, 2011 - 06:13 PM
Veteran Member
Veteran Member


Joined: Jul 01, 2006
Posts: 126

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
Post subject: RE: Servlet 3.0 Support  PostPosted: Jun 27, 2011 - 06:16 AM



Joined: Nov 11, 2010
Posts: 2153

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
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits