Java server applications need not be difficult and tedious to create. Now in its second generation, the lightweight Spring framework adds a large suite of features that make it simple for even new server application developers to use. One key enhancement is Spring 2's integration with the Java Persistence API (JPA), a cornerstone of the Enterprise JavaBeans (EJB) 3.0 specification. In this tutorial, learn how to create server applications from scratch using the Spring 2 framework.
835 名前:824 mailto:sage [2006/08/28(月) 18:26:13 ]
その次
Before you start
For almost a decade, the "proper" way to build a robust and maintainable server-side Java application has been the exclusive domain of the Java 2 Enterprise Edition (J2EE) platform.
J2EE applications are built using Enterprise JavaBeans (EJB) technology and run on servers that facilitate deployment and provide rich container services (such as the management of database connections and pooling).
These servers also add value by providing deploy-time declarative control of important features such as security and transactions. Although versatile, the J2EE development process involves many tedious and repetitive tasks and the creation and maintenance of large numbers of source code files.
Many lightweight Java frameworks claim to simplify server application development, but none matches the Spring framework in maturity and popularity (see Resources). Now in version 2, Spring was designed from day one to simplify the server application building process.
Instead of approaching development from an all-in-one container perspective, Spring aims to provide just enough support for an application's requirements without the burden of a full-fledged container environment. Spring eliminates code bloat: you can code and test business objects completely outside of any container, letting your business-object code remain simple, testable, maintainable, and reusable.
With the arrival of Java EE 5 and EJB 3.0, the J2EE community is poised to meet the Spring developer community. EJB 3.0 supports the notion of lightweight POJOs (Plain Old Java Objects) as EJB components and introduces the Java Persistence API (JPA), a persistence mechanism that can run externally to the container.
This persistence mechanism automates the movement of information between business objects and external relational databases.
Version 2 of the Spring framework has continued its evolution and also leverages JPA as a persistence mechanism.
In this tutorial, you will work with Spring 2 and JPA persistence. You'll create a server application using the Spring 2 framework, complete with access to a DB2 Express-C database. The Eclipse IDE facilitates the development of the Java application and enhances your exploration of the Spring 2 framework.
new TOAnnotationXmlApplicationContext("classpath*:applicationContext.xml").getBean("bean"); だと、 NoSuchBeanDefinitionExceptionが返ってきて"No bean named 'bean' is defined"って言われる。