Monday September 14, 2009
TOTD #102: Java EE 6 (Servlet 3.0 and EJB 3.1) wizards in Eclipse
The Eclipse community's WTP release with Java EE 6 support has been delayed to Jun 2010. So how do you do Java EE 6 development in Eclipse until then ?
The GlassFish team is trying to bridge the gap by adding new Java EE 6 wizards that allows you to create Servlet 3.0- (JSR 315) and EJB 3.1- (JSR 318) compliant artifacts. So for the first time, in Eclipse, a Java EE 6 application can be created using the GlassFish plugin for Eclipse (ver 1.0.32)! GlassFish v3 is the Java EE 6 in making and so Eclipse and GlassFish v3 together provides you a good environment for your Java EE 6 development.
This Tip Of The Day (TOTD) explains how to use those wizards using Eclipse 3.4.2. If you have an earlier version of plugin already installed then update it as described in TOTD #66. Make sure to use ver 1.0.33 (recently released) if you are using Eclipse 3.5.x. If you have an earlier version of GlassFish plugin installed, then you may have to start Eclipse with "-clean" flag, basically as "eclipse -clean", after updating the plugin. This will allow the environment to detect the new plugins.






protected void doProcess(HttpServletRequest request, HttpServletResponse response) throws IOException {
ServletOutputStream out = response.getOutputStream();
out.print("<html><body>");
out.print("Request received at: " + request.getContextPath());
out.print("</body></html>");
}




public String sayHello(String name) {
return "Hello " + name;
}
@EJB HelloBean bean;
protected void doProcess(HttpServletRequest request, HttpServletResponse response) throws IOException {
ServletOutputStream out = response.getOutputStream();
out.print("<html><body>");
out.print("Request received at: " + request.getContextPath());
out.print("<br>" + bean.sayHello("Duke"));
out.print("</body></html>");
}

So we built a Java EE 6 application using the newly added Servlet 3.0 and EJB 3.1 wizards in GlassFish Plugin for Eclipse.
Please send your feedback and questions to users@glassfishplugins.dev.java.net. Let us know what other Java EE 6 features you'd like to see in Eclipse.
A complete archive of all the tips is available here.
Technorati: totd glassfish v3 eclipse javaee servlet3 ejb
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
|
Today's Page Hits: 3161
Total # blog entries: 1002