Ensar Basri Kahveci

overly distributed

Recent posts

Sep 2, 2012
Embedding Groovy scripts into your Java application I like Groovy for a lot of things like being easy to learn, its dynamic feature, readable syntax etc. But one of the things I like and utilize most is its embedding feature which helps you to run Groovy scripts in your already-running Java application. If you have a stateful Java application, running arbitrary Groovy scripts to examine your state can be very useful when things screw up on run-time.…
Jun 20, 2012
A Simple Jedis Publish / Subscribe Example Hello again, after more than 4 months :) So many things have changed in my life since my last blog post. I will try to talk about them from time to time, which I am not very sure about that actually :) I have been playing with Redis and its Java client Jedis lately. It looks very promising. I’m making experimental things on it and I really liked it. I will probably use it one of my personal projects for some use cases.…
Dec 25, 2011
Integration Testing with Maven, Jetty and Selenium 2 For the last few days, I was busy with preparing a integration test environment for our PrimeFaces showcase. Showcase project was already a Maven project, so I made a little research about maven phases, maven plugins, Selenium and Jetty and figured out how can I make things work. You can see similar blog posts on Google about the topic. I looked at most of them and they helped me on the way.…
Oct 21, 2011
Configuring Spring Security to persist the SecurityContext to places other than session between requests Yeah I agree, I suck at titles :) But, again and again, Spring guys are real badasses :) By default, Spring Security keeps the SecurityContext object in session objects of user between requests. SecurityContextPersistenceFilter manages this task. When a request comes, it reads the SecurityContext object from a security context repository (which I will mention in a second), puts it to SecurityContextHolder to be used by other filters and the application.…
Oct 3, 2011
Extending Spring's OpenSessionInViewFilter to not open sessions for request to static resources If you are using OpenSessionInViewFilter in your application, you may be opening sessions for requests which don’t actually do any session-related things, simply accessing to css, javascript or image files. When you get your requests like images, js files with static urls not from servlets, the case will not happen. But for example, if you use JSF and map your “*.jsf” urls to Faces Servlet and filter it with OpenSessionInView filter to avoid lazy loading exceptions in your facelets, JSF fill send requests to your Faces Servlet to load resources like images, css files, js files and you will open session for those request too although not necessary.…