In this tutorial, I will show you how to integrate Spring 3 with Log4j. Tools and technologies used : Spring Log4j Maven Eclipse Following example demonstrates a simple Hello World web application using Spring MVC that will show logging message on Console. First create a new Dynamic Web Project and configure it as Maven Project. [...]
Archive | Spring
RSS feed for this sectionSpring + Hibernate + MySql + Maven Example
In this tutorial, I will show you how to integrate Hibernate with Spring 3. Tools and technologies used : Hibernate Spring MySql Maven Eclipse First create a new Dynamic Web Project and configure it as Maven Project. For Reference, Click Here Add the following dependencies in pom.xml 1. Sql Script Use the following Sql Script [...]
Spring <form:textarea> Tag
In this Spring example, you will learn how to create a HTML textarea with Spring <form:textarea> tag. For Example : In order to use the Spring Form Tags you need to include the following taglib directive in the jsp page. First create a new Dynamic Web Project and configure it as Maven Project. For Reference, [...]
Collections in SpEL
You can reference a single member of a collection in SpEL, just like in Java. But SpEL also has the power to select members of a collection based on the values of their properties. It can also extract properties out of the collection members into a new collection. Accessing Collection Members The most basic thing [...]
Expression Evaluation using Spring’s Expression Interface
ExpressionParser parses expression strings into compiled expressions that can be evaluated. It also supports parsing templates as well as standard expression strings. Following code demonstrates few examples of “ExpressionParser” interface. You can download the source code of this example here.
Arithmethic Operations using Spring Expression Language
SpEL supports all of the basic arithmetic operators that Java supports, plus the carat (^) operator for performing a power of operation. Following example demonstrates arithmetic operations using Spring Expression Language. First create a new Java Project and configure it as Maven Project. For Reference, Click Here Add the following dependencies in pom.xml 1. POJO [...]
Operators in Spring Expression Language
SpEL offers several operations that you can apply on values in a SpEL expression. Table 1.1 SpEL Operators Operation type Operators Arithmetic +, -, *, /, %, ^ Relational , ==, =, lt, gt, eq, le, ge Logical and, or, not, | Conditional ?: (ternary), ?: (Elvis) Regular expression matches Arithmetic Operators SpEL supports all [...]
Invoke method using Spring Expression Language
You can also invoke a method using Spring Expression Language. Following example demonstrates how to invoke method using Spring Expression Language. First create a new Java Project and configure it as Maven Project. For Reference, Click Here Add the following dependencies in pom.xml 1. POJO Create Instrument Class as following 2. Configuration Create Spring-Bean.xml and [...]
Injecting values using Annotation (SpEL)
When using annotation-style value injection, we just need to substitute the value annotations with the SpEL expressions. Following example demonstrates injecting values with Annotation based configuration using Spring Expression Language. First create a new Java Project and configure it as Maven Project. For Reference, Click Here Add the following dependencies in pom.xml 1. POJO Create [...]
Injecting values using XML (SpEL)
We can define the bean in the XML configuration and use SpEL to inject the bean’s properties into the dependent bean. Following example demonstrates injecting values with XML based configuration using Spring Expression Language. First create a new Java Project and configure it as Maven Project. For Reference, Click Here Add the following dependencies in [...]
Spring Tutorial
Spring Dependency Injection / lOC
- Spring Dependency Injection / IOC
- Constructor Type Dependency Injection
- Setter Type Dependency Injection
Spring Bean
Spring MVC
Spring MultiActionController
Spring AOP (Aspect-oriented programming)
- Spring AOP - Advice
- Spring AOP MethodBeforeAdvice
- Spring AOP AfterReturningAdvice
- Spring AOP AfterThrowingAdvice
- Spring AOP AroundAdvice
- Pointcut - Name Match Example
- Pointcut - Regular Expression Example
Spring AOP + AspectJ
- Spring AOP using Annotation + AspectJ
- AspectJ @Before
- AspectJ @After
- AspectJ @AfterReturning
- AspectJ @AfterThrowing
- AspectJ @Around
- Spring AOP XML Configuration + AspectJ
- AspectJ before <aop:before>
- AspectJ after <aop:after>
- AspectJ afterReturning <aop:after-returning>
- AspectJ afterThrowing <aop:after-throwing>
- AspectJ around <aop:around>
- Passing parameters to aspect
- Spring + Hibernate + MySql + Maven Example January 15, 2013
- Hibernate One To Many Mapping using Annotation August 4, 2012
- Struts SwitchAction August 14, 2012
- Configure Multiple Handler Mappings in Spring MVC November 28, 2012
- Spring <form:radiobutton> and <form:radiobuttons> Tag November 21, 2012
- How to change Java Version in Linux? March 22, 2013
- Installing MySql Workbench in Fedora March 21, 2013
- Logback Logging Example January 31, 2013
- Limit WordPress Search To Post Titles January 16, 2013
- JDBC Introduction January 16, 2013
