RECENT POSTS
Difference between Struts2 FilterDispatcher and StrutsPrepareAndExecuteFilter?
The FilterDispatcher is used in the early Struts2 development, and it has deprecated since Struts 2.1.3. ** UPDATE: Struts 2 Complete tutorial now available here. If you are using Struts version >= 2.1.3, it’s recommended to upgrade the new filter class StrutsPrepareAndExecuteFilter The new filter was introduced for the following reasons There were a lot of issued with the FilterDispatcher and its deployment. New Filter provides a better way to enable customizations and overrides. Make it crystal clear to...
read moreDesigner Workflow 2010: Unable to load workflow actions from the server. Please contact your server administrator
Unable to load workflow actions from the server
read moreAspect Oriented Programming(AOP)
AOP is one of the main features available in spring that facilitate Cross-cutting of concerns. AOP is another way of organizing the program structure, that complements the OOP. The modularity is implemented in OOP using class, whereas in AOP aspect takes up the job. Aspects enable the modularization of concerns such as transaction management that cut across multiple types and objects. Spring IOC container does not depend upon AOP. That is, using of AOP is totally up to the requirements at hand. AOP...
read moreDependency Injection(DI)
One of the most striking features of Spring, is the way loose coupling between the components has been achieved. The modules are made independent by keeping them abstract. The values / dependencies are injected to them through the underlying Spring framework’s IOC container. Three types of dependency Injection are available. 1. Setter injection 2. Constructor injection 3. Interface injection The value can be set using either constructor injection or setter injection. Note : Interface injection is not mainly supported...
read moreSpring AOP – AfterThrows Advice
Download It Spring AOP – AfterThrowsAdvice Requirement : In case a particular method call throws an exception, a log needs to be printed. ** UPDATE: Spring Complete tutorial now available here. Step 1 : Changes in IteratorImpl class to mock an exception being thrown. No change in IteratorImpl interface File : Iterator.java package com.simpleCodeStuffs.aop; public interface Iterator { void goPrevious(); void goNext(); } File : ...
read moreBean Method invocation using spEL
Download It Bean Method invocation using spEL Step 1 : Create the POJO File : Customer.java package com.simpleCodeStuffs.spEL; public class Customer { private String name; private double bill; public String getName() { return name; } public void setName(String name) { this.name = name; } public double getBill() { return bill; } public void setBill(double bill) { this.bill = bill; } } File : Amount.java package...
read moreBasic example of Spring AOP Concept using BeforeAdvice
Download It Simple example for AOP concept -BeforeAdvice Take an example wherein there exists an interface ‘Iterator’. It is implemented by a class ‘IteratorImpl’(which obviously, overrides the methods of ‘Iterator’, in this case goNext() ). Consider a scenario wherein this set up is part of a very large code. Now, I get a requirement to insert a logging step into this code. This can be done using AOP with no impact at all on the existing...
read moreOperators in spEL
Download It Operators in spEL The various operators that are most frequently used in this context are :- Relational operators equal (==) not equal (!=) less than (<) less than or equal (<=) greater than (>) greater than or equal (>=) Logical operators And(&&) Or(||) not (!). Mathematical operators addition (+) Subtraction (-) Multiplication (*) division (/) modulus (%) exponential power (^). Ternary operator if-then-else...
read moreWhat is the use of the finally block? Is finally block in Java guaranteed to be called? When finally block is NOT called?
Finally is the block of code that executes always. The code in finally block will execute even if an exception is occurred. Finally block is NOT called in following conditions If the JVM exits while the try or catch code is being executed, then the finally block may not execute. This may happen due to System.exit() call. if the thread executing the try or catch code is interrupted or killed, the finally block may not execute even though the application as a whole continues. If a exception is thrown in finally block and not handled then...
read more