J2EETM Development with NetBeans Petr Jiricka Agenda Overview of J2EEtechnologies Sun J2EEsoftware Prague Engineering Center Overview of NetBeans NetBeans 4.0: Web Tier support NetBeans 4.1: Enterprise JavaBeansTM and Web Services Future directions of J2EE J2EEOverview Platform for developing and deploying complex enterprise applications One of two most successful platforms Developed in Java Community Process (JCP) ­ 1.4 is the current version, 5.0 (1.5) in progress ­ Specification, Reference Implementation, Technology Compatibility Kit (TCK) Implemented by multiple vendors ­ Sun, BEA, Oracle, IBM, Apache, JBoss, ... J2EETechnologies Major technologies ­ Servlets ­ JavaServer PagesTM ­ Enterprise JavaBeansTM ­ Web Services, JAX-* ­ JDBC ­ JNDI ­ JMS ­ JavaMail ­ ... Related technologies and products JavaServer Faces (JSF) JavaServer Pages Standard Tag Library (JSTL) Portlets Naming and directory management, LDAP Identity management, Liberty alliance ... Additional aspects of J2EE Multiple types of clients Transactions Security, authentication, authorization Data persistence Distribution Integration with existing systems Internationalization and localization Clustering, scalability, high availability Challenges of J2EEdevelopment Learning many different technologies Use of multiple languages (Java, JSP, XML, SQL, EJB-QL, ...) Teamwork Many aspects of development Performance, making it efficient "One size does not fit all" Making J2EEdevelopment easier Sample code Tutorials Reference architectures Frameworks Books Simplify core specifications Tools Sun Java Enterprise System Integrated set of products ­ Application Server ­ Web Server ­ Naming and Directory Server ­ Portal Server ­ Identity Server ­ ... Sun Java System Application Server Several editions ­ Platform Edition ­ Standard Edition ­ Enterprise Edition Latest version is 8.0 (Platform Edition) ­ Supports J2EE1.4 ­ 8.1 under development, beta is released J2EEDeveloper Resources Sun Java Developer Tools NetBeans ­ FREE ­ Supports J2SE, J2EEweb tier ­ Will support full J2EEsoon ­ Integrated with SJS Application Server Platform Edition Sun Java Studio Creator ­ Visual development of web applications ­ Natively supports JavaServer Faces ­ Affordable: only 100$/ year/ developer, free evaluation ­ Built on NetBeans Sun Java Developer Tools (cont'd) Sun Java Studio Enterprise ­ High end tool ­ Supports UML, team collaboration features ­ Integrated with Sun Java Enterprise System ­ Built on NetBeans NetBeans Mobility Pack ­ J2ME(MIDP) development ­ Will support J2MEweb services (JSR172) Prague Engineering Center Several engineering teams ­ NetBeans ­ NetBeans Mobility ­ Java Enterprise System ­ Globalization University relations Prague will GROW ­ Expand existing teams ­ New teams in Prague NetBeans FREEJava development tool Open source project Supports J2SE, J2MEand J2EE Community contributes bug reports, fixes, new modules, requests new features NetBeans 4.0 Landmark release ­ New Project system based on Apache Ant ­ Support for Java refactoring ­ Supports J2SE5.0 release (Tiger) Other new features ­ Improved UI (window system) ­ Performance enhancements, UI responsiveness Web Development with NetBeans 4.0 Web Application project type Supports J2EE1.3 and 1.4 Integrates with the bundled Tomcat 5 server Integrates with SJS Application Server 8, Platform Edition (separate download) All stages of the development cycle ­ Create, Edit, Build, Deploy, Debug Web Development ­ Create Create projects ­ Web Application project from scratch ­ Web Application project with existing sources ­ Web Application project with existing Ant script Create components ­ JSP pages, HTMLpages, servlets, tag files, tag libraries, filters, listeners, ... ­ Manage deployment descriptor automatically Includes JSP Standard Tag Library (JSTL) Web Development ­ Edit JSP Editor ­ Coloring of HTML, JSP, Java and Expression Language elements ­ Context-sensitive code completion ­ Help for JSP syntax ­ Formatting, tag matching, "smart case", ... ­ Similar features also for Tag Files Java editor aware of J2EEAPIs Code completion for deployment descriptors Web Development ­ Build Build is completely driven by Ant Ant script automatically maintained by the Project system Respects common conventions ­ "build" and "dist" directories ­ Jakarta and Java BluePrints source structures Compile JSPs to discover coding errors Web Development ­ Deploy Tomcat 5 included with NetBeans One-click deployment Fast iterative redeployment View server logs Web Development ­ Debug Automatically start server in debug mode Step through Java and JSP code Evaluate expressions (as tooltips) HTTP monitor ­ Records all HTTP transactions between the browser and the server ­ Displays HTTP parameters, cookies, session data, HTTP headers, browser and server info, ... ­ Allows replay ing transactions recorded previously Demo ­ NetBeans 4.0 NetBeans 4.1 Complete J2EEdevelopment support ­ Enterprise JavaBeansTM ­ Web Services Will support J2EE1.4 Will integrate with SJS Application Server 8.1, Platform Edition From the Computer History Museum in Santa Clara, California NetBeans 4.1 Goals Make it easier to develop J2EEapplications Make experienced developers more productive Help beginners learn J2EEdevelopment Do not require in-depth knowledge of all details of J2EE Help by providing ent-to-end support, integrated experience Out Of Box Experience (OOBE) J2EEin NetBeans 4.1 ­ basic features New Project types ­ EJBModule project ­ J2EEApplication project ­ Web Services developed in Web project or EJB Module project Wizards for J2EEcomponents Enterprise JavaBeansTM Development Create EJBs ­ Entity Bean, CMP Entity Beans using an existing database, Session Bean, Message Driven Bean Automatically manage depl. descriptors High level operations (add business method) Visual deployment descriptor editor "Call EJB" action Web Services Development Create Web service operations ­ From scratch ­ From an existing Java class ­ From an existing WSDLfile Automatically manage all configuration files Supports common web service standards ­ SOAP, WSDL, JAX-RPC, JSR109, ... More J2EEfeatures Verification of J2EEapplications Manage and edit server-specific deployment descriptors Refactoring integrated with J2EE Java BluePrints solution catalog Sample J2EEprojects NetBeans 4.1 Schedule Early Access 1 was released in October 2004 Early Access 2 in January 2005 Beta in Q1 CY2005 Final version in 1st half of 2005 Demo ­ NetBeans 4.1 The Future of J2EE J2EE5.0 (1.5) will be the next major release Extensive use of annotations (JSR175, introduced in J2SE5.0) Enhancements in ­ CMP beans ­ New Web Services standards ­ Align JSP and JSF ­ ... Enterprise JavaBeansTM in J2EE5.0 EJB3.0 (JSR220) ­ early draft released Annotations @Stateful public class CartBean implements ShoppingCart { ­ Annotations replace deployment descriptors ­ EJBs are Plain Old Java Objects (POJO) EJBQLenhancements Enhanced Object-Relational mapping New APIs for entity beans ­ javax.ejb.EntityManager, javax.ejb.Query Web Services in J2EE5.0 JAX-RPC2.0 ­ Improved binding of Java data types to XML ­ Built on top of JAXB2.0 JAXB2.0 (Java API for XMLBinding) Fast Web Services ­ Use of binary encoding of SOAP messages Annotations for Web Services (JSR181) Web Services Security, digital signatures, ... Web tier technologies in J2EE5.0 Align JSP and JSF ­ JSP 2.1 and JSF1.2 ­ Align expression languages ${JSP Expression} #{JSF Expression} ­ Use managed beans in JSP Links http:/ / java.sun.com/ j2ee/ index.jsp ­ J2EEmain page, downloads of J2EESDK(aka SJS Application Server 8.0 PE), samples, API docs, J2EE Blueprints, ... NetBeans community mailing lists www.netbeans.org -NetBeans nbusers@netbeans.org ­ general user questions nbj2ee@netbeans.org ­ questions about J2EEdevt. Prague Engineering Center www.sun.cz Q&A J2EETM Development with NetBeans Petr Jiricka Backup slides J2SETM 5.0 "Tiger" There's lots of great stuff in Tiger JMX Concurrency utilities Generics Ocean L&F extended for loop JVM Monitoring metadata SAX 2.0 Enumerated types printf importing constants Autoboxing Unicode Surrogates Remote JMX DOM 3 Gnome Skins XML Schema JVMPI Profiling Stack trace API JVM sharing XAWT AMD64 performance faster startup improved footprint BigDecimal updates JDBC Rowsets SASL New Memory ModelPacked JARs performance ergonomics jpsjstat varargs apt fatal error handlers jconsole OpenGL synth L&F improved cookie support RMI dynamic proxies z-ordering swing printing OCSPXDnD IP reachability unsynchronized StringBuffer scanning And lots more...