In our previous post we deployed a Spring MVC app using embedded H2 database to Tomcat. Browsing the data in an embedded DB is difficult because we cannot connect an external client to view the data. H2 provides a Web… Read More ›
Java
How to Deploy Spring Application Without web.xml to Tomcat
Introduction Since the Servlet 3 specification web.xml is no longer needed for configuring your web application and has been replaced by using annotations. In this article, we will look at how to deploy a simple Spring-based application without web.xml to… Read More ›
My First book Java 9 Cookbook, Packt Publications – Over 100 Java recipes covered
Packt Publications recently published Java 9 Cookbook co-authored by me along with my co-author, a seasoned developer, Nick Samoylov. Yes!! This is my first publication and hopefully first of much more to come. We have tried to cover as many… Read More ›
Using Gmail as SMTP server from Java, Spring Boot apps
Gmail users can use Gmail’s SMTP server smtp.gmail.com to send emails from their Spring Boot apps. For this let us do some setup in the app: Provide SMTP connection properties in the application.properties file: spring.mail.host=smtp.gmail.com spring.mail.username=<your gmail/google app email> spring.mail.password=***** spring.mail.port=587… Read More ›
Getting to know about java.nio.file.Path – 2
In Part 1 of this, we looked at most of the APIs in the java.nio.file.Path class. In this article, we will look at the remaining APIs. Using register() This API allows us to register an implementation of java.nio.file.WatchService interface which… Read More ›
Getting to know about java.nio.file.Path – 1
Introduction The last few released of Java namely Java 7, Java 8 and the upcoming Java 9 have quite a lot of features which makes the life of Java developers easier. (I know Java 9 will make it tougher, but… Read More ›
Behavior Driven Development (BDD) of Postfix calculator
What is a postfix expression? An expression where in the operator is placed after the operands is called a postfix expression. For example an expression (also called infix expression) 2 + 3 in postfix is 2 3 +, expression 2… Read More ›
Gotcha: Migrating from Spring Security 3.2.x to Spring Security 4.x
Here is a simple gotcha to keep in mind while migrating to newer Spring Security version 4.x from Spring Security 3.2.x What’s the problem? The Spring security configuration expressions hasRole(‘role_name’) and hasAuthority(‘role_name’) are no longer the same. The catch is:… Read More ›
New @RequestParam annotations in Spring Boot 1.4 (Spring Framework 4.3)
Earlier in Spring/Spring Boot to Map a GET or POST or DELETE or any HTTP method request handler we would write something like below: But with Springframework 4.3 and Spring Boot 1.4 (which now uses Springframework 4.3) we have some… Read More ›
Java Gotcha: Parse string using SimpleDateFormat with months greater than 12
I was the other day trying to parse a date string into a date object using SimpleDateFormat to check for the validity of the date string. I had the SimpleDateFormat defined as: SimpleDateFormat expiryDateFormat = new SimpleDateFormat(“dd/MM/yyyy”);. The date string… Read More ›