Category: Java

  • Index and Search a Directory using Apache Lucene

    Building a custom search is a common requirement in almost every application. Building such a system can be complex and tedious with numerous use cases around. Apache Lucene is a search framework built in Java. In this tutorial we will write a small application which will use Lucene to search a given directory. Lucene works…

  • Audit Framework with Spring AOP and JPA

    Every now and then we come across a common requirement of building an Audit framework. In simple words it means whenever a record is added, edited or removed there should be an entry made in a separate table so that different actions of users can be monitored. Today in this tutorial we will build an…

  • Accessing method arguments using Spring AOP

    Earlier we used Spring AOP to weave common logging functionality to our BookShelf add and remove methods. But those were plain log statements, what if we want to log which Book is being added/removed. Spring AOP provides @Around advice which can be used to get this use case working. First we will enhance our Book.java…

  • QuickFIX/J Book a FX Trade

    In our last tutorial we created a basic initiator and an acceptor. In this post we will enhance our code and we will book a single order. First we will enhance our executor class which is TestTradeAppExecutor.java. Important thing to note : Extends MessageCracker – which provides callback methods Implementation of fromApp cracks the message…

  • QuickFIXJ Initiator Acceptor Integration

    This post is beginning of a set of tutorial which we will write as part of building a web based application which will use QuickFIX/J for trade booking. By end of this tutorial you should have an initiator and acceptor with valid login working. In previous post we created an initiator. Though in this post…

  • Spring AOP using Annotation

    AOP a.k.a Aspect Oriented programming using Spring is a common usage now. In a nutshell it provides common functionality to be weaved into beans. Functionalities like logging before and after method is executed instead of being part of actual method implementation can be wired. Some important notes about AOP with Spring: Spring AOP is implemented…

  • Secure your business layer with JSR-250 and Spring Security in a JSF application

    In the previouspost we looked at the different option that we have as part of Java EE and Spring security framework. In this tutorial we will see how we can leverage JSR-250 security annotation. To being with you need the source code from previous post. With some code behind us, let’s see how JSR-250 can…

  • Business Layer Security with Java EE and Spring

    If you have read previous tutorial about Spring Security and JSF you would have noticed that all this time we have been speaking about securing our web layer. What about business layer ? In this post we will go through few ways of securing our business layer, and then in subsequent post we will see…

  • Spring Security 3.1 conditionally securing your web page with JSF 2.0

    Hello, in all our previous use cases we secured a whole page, but what if we want to secure only a certain element or part ? Consider a scenario where message displayed on admin login and guest login is different, message is a very simple example, you may want to show different menu to admin.…

  • Spring Security 3.1 Adding Salt to Password using BCryptPasswordEncoder and JSF 2.0

    In the last post, we used StandardPasswordEncoder for encoding our password. In this tutorial we will use BCryptPasswordEncoder for encoding. This provides more security, you can even specify the strength by default it is 10, and in this post we are using the default configuration, we will see the custom configuration in next post. First…