Home » Author Archives: Gal Levinsky

Author Archives: Gal Levinsky

Graduated B.s.c Information System Engineering on BGU University (2004). Been working on large cloud based ERP application in SAP for 7 years and as a development group manager in affiliation company. Co-founded few startups in the domain of social web.

Resolve circular dependency in Spring Autowiring

spring-interview-questions-answers

I would consider this post as best practice for using Spring in enterprise application development. When writing enterprise web application using Spring, the amount of services in the service layer, will probably grow. Each service in the service layer will probably consume other services, which will be injected via @Autowire . The problem: When services number start growing, a circular ...

Read More »

Spring security 3 Ajax login – accessing protected resources

spring-interview-questions-answers

I have seen some blogs about Spring Security 3 Ajax login, however I could not find any that tackles how to invoke Ajax based login, where a protected resource is being accessed in Ajax by an anonymous user. The problem – The web application enables anonymous access to certain parts and certain parts are protected resources which require the user ...

Read More »

DAO layer – Generics to the rescue

java-interview-questions-answers

Generics can be a powerful tool to create reusable code with the power of compile time verification (type safety..). Unfortunately I feel the main stream developers still afraid of it. However, in analogy to Hagrid’s spiders I would say that Generics are seriously misunderstood creatures… :-) I hope the following example will demonstrate how useful they can be. The Problem ...

Read More »

Spring Profile pattern example

spring-interview-questions-answers

Recently we were introduced with the concept of Spring Profiles. This concept is an easy configuration differentiators for different deployment environments. The straight forward use case (which was presented) was to annotate the relevant classes so Spring would load the appropriate class according to the active profile. However, this approach might not always serve the common use case… often, the ...

Read More »

Build documentation to last – choose the agile way

agile-logo

Lately I wondered what the best way to document a project is? My documentation experience vary among different tools and methodologies.  I would like to share some observation I have and a conclusion about the best way to document a project. The documentation could be classified to the following categories: Documentation place: In line code/ version control system (via code ...

Read More »

How to change logging level in runtime

apache-log4j-logo

Changing the log logging level in runtime is important mainly in production environment where you might want to have debug logging for limited amount of time. Well, changing the root logger is very simple – assuming you have an input parameter with the wanted logging level simply get the root logger and set by the input logging level, such as: ...

Read More »

Email filtering using Aspect and Spring Profile

spring-interview-questions-answers

During web application development, often the need for sending emails arise. However, sometimes the database is populated by data from production and there is a risk of sending emails to real customers during email test execution. This post will explain how to avoid it without explicitly write code in the send email function. We would use 2 techniques: Spring Profiles ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.