Beruflich Dokumente
Kultur Dokumente
Bean Basic
All the classes you need to use in Spring Ioc container are considered bean, and declared in
a Spring bean configuration file or via annotation.
modules folder, heres a tip to show you how to load multiple Spring bean
configuration files.
ListFactoryBean example
Create a concrete List collection class (ArrayList and LinkedList), and inject
it into bean property.
SetFactoryBean example
Create a concrete Set collection class (HashSet and TreeSet), and inject it
into bean property.
MapFactoryBean example
Create a concrete Map collection class (HashMap and TreeMap), and inject
it into bean property.
Spring 3.0 introduces features rich and powerful expression language known as Spring
expression language, or Spring EL.
Spring auto-wiring modes to wire or beans automatically, both in XML and annotation.
The Spring AOP modularize cross-cutting concerns in aspects. Put it simply, an interceptor to
intercept some methods.
AspectJ supported since Spring 2.0, more flexible and powerful. However, this example is
demonstrated in Spring 3.0.
In Spring 3.0, Object to XML mapping (OXM) is moved from the Spring Web Services to the
core Spring Framework.
Spring provides many helper classes to simplify the overall JDBC database operation.
Spring comes with many handy classes to support Hibernate ORM framework.
Spring has very good support in both JDK timer and Quartz framework.
Spring FAQs
ClassNotFoundException :
org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.exolab.castor.xml.XMLException
java.lang.ClassNotFoundException: org.apache.xml.serialize.XMLSerializer
2. Handler Mapping
BeanNameUrlHandlerMapping example
Maps the requested URL to the name of the cocntroller.
ControllerClassNameHandlerMapping example
Uses convention to map the requested URL to Controller.
SimpleUrlHandlerMapping example
Allow developer to specify the mapping of URL patterns and handler
mappings explicitly.
. Controller
MultiActionController example
Group related actions into a single controller class.
PropertiesMethodNameResolver example
A flexible method name resolver for the MultiActionController controller
class, it allow to define the mapping between requested URL and method
name explicitly.
ParameterMethodNameResolver example
Another method name resolver for the MultiActionController controller
class, it allow to map URL to method name via requested parameter
name.
ParameterizableViewController example
With ParameterizableViewController, you dont need to hard code the view
name in the controller class anymore, instead, you specify the view name
through the ParameterizableViewControllers viewName property.
4. View Resolver
Resolve view name that returned from the controller class to a physical view page or JSP
page.
InternalResourceViewResolver example
Adding a predefined prefix and suffix to the view name (prefix + view
name + suffix), and generate the final view page URL.
XmlViewResolver example
Puts view beans in XML file.
ResourceBundleViewResolver example
Puts view beans in .properties file.
5. Form Handling
RedirectView example
A view which redirect to another absolute, context relative, or current
request relative URL.
Textbox example
<form:input /> tag, render a HTML textbox field.
Password example
<form:password /> tag, render a HTML password field.
Textarea example
<form:textarea /> tag, render a HTML textarea field.
8. FAQs
Internationalization example
Multiple languages supported in Spring MVC.
Neither BindingResult nor plain target object for bean name xxx available
as request attribute
ClassNotFoundException : com.sun.syndication.feed.WireFeed
ClassNotFoundException :
com.thoughtworks.xstream.io.HierarchicalStreamReader
Examples to show you how to secure your web application with Spring Security.
Spring Security Form Login Using Database XML and Annotation Example
Database authentication, Spring Security, JSP taglibs, JDBC, customizes
403 access denied page and etc, both in XML and annotations.
2. FAQs
ClassNotFoundException :
org.springframework.security.web.savedrequest.DefaultSavedRequest
The following Spring Batch tutorials and examples are tested with :
1. Spring Core 3.2.2.RELEASE
2. Spring Batch 2.2.0.RELEASE
Few examples to show the use of Spring batch classes to read/write resources (csv, xml and
database).
3. Scheduler
4. Unit Test
5. Advance