Home » Author Archives: Biju Kunjummen (page 5)

Author Archives: Biju Kunjummen

Spring test with thymeleaf for views

spring-interview-questions-answers

I am a recent convert to thymeleaf for view templating in Spring based web applications, preferring it over jsp’s. All the arguments that thymeleaf documentation makes on why thymeleaf over jsp holds water and I am definitely sold. One of the big reasons for me, apart from being able to preview the template, is the way the view is rendered ...

Read More »

Memoization of Scala Streams

scala-logo

I learnt the hard way that scala internally uses memoization with Streams. This was my first attempt at a solution to Euler Problem 5                 def from(n: Int): Stream[Int] = n #:: from(n + 1) def isDivisibleByRange(n: Int, r: Range) = { r.forall(n % _ == 0) } val a = from(21) val ...

Read More »

Spring-boot and Scala

spring-interview-questions-answers

There is actually nothing very special about writing a Spring-boot web application purely using Scala, it just works! In this blog entry, I will slowly transform a Java based Spring-boot application completely to Scala – the Java based sample is available at this github location – https://github.com/bijukunjummen/spring-boot-mvc-test To start with, I had the option of going with either a maven ...

Read More »

Websockets with Spring 4

spring-interview-questions-answers

I am throwing the entire kitchen sink into a small web application that I am developing as part of this post – Spring Boot, Spring Integration, RabbitMQ and finally the topic of the post, the Websocket support in Spring MVC with Spring 4. Real-time quake listing application The final app will list the earthquake occurrences around the world and is ...

Read More »

Spring Integration Standalone application with Spring Boot

spring-interview-questions-answers

I had earlier blogged about a way to write a standalone Spring Integration application. Spring Boot makes creating this standalone application much simpler. The simple flow was to poll the USGS service providing information about the earthquake activity around the world and to log this information. The flow described using Spring Integration is the following:           ...

Read More »

Consuming Spring-hateoas Rest service using Spring RestTemplate and Super type tokens

spring-interview-questions-answers

Spring-hateoas provides an excellent way for applications to create REST based services which follow the HATEOAS principle. My objective here is not to show how to create the service itself, but to demonstrate how to write a client to the service. The sample service that I am going to use is the ” the-spring-rest-stack” written by Josh Long( @starbuxman). The ...

Read More »

Spring Integration Publisher

spring-interview-questions-answers

Consider a hypothetical requirement – You have a service class in your application and you want to capture some information around the calls to this service:                   @Service public class SampleBean { private static final Logger logger = LoggerFactory.getLogger(SampleBean.class); public Response call(Request request) { logger.info("SampleBean.call invoked"); return new Response(true); } } AOP ...

Read More »

java.util.Random in Java 8

java-logo

One of the neat features of java.util.Random class in Java 8 is that it has been retrofitted to now return a random Stream of numbers. For eg, to generate an infinite stream of random doubles between 0(inclusive) and 1(exclusive):               Random random = new Random(); DoubleStream doubleStream = random.doubles(); or to generate an infinite ...

Read More »

Java 8 parameter name at runtime

java-logo

Java 8 will be introducing an easier way to discover the parameter names of methods and constructors. Prior to Java 8, the way to find the parameter names is by turning the debug symbols on at the compilation stage which adds meta information about the parameter names in the generated class files then to extract the information which is complicated ...

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.