Spring Boot with JWT authentication using Redis

It has been a long time since i posted any java related blog post. Today it is a time i came up from my busy schedule. So in this post i am just only going to demonstrate how to add JWT authentication for small boot application which will use redis for saving its user’s session and information. There are many way we can use session but lets try this time with Redis as primary source for session storage.

I have my redis server in my VMWare which is opened in default port  6379. So now all i need is small spring boot application to get started. Lets start a new project with clean maven project and some dependencies essential for making JWT Token based session using redis.

1. Project Create

Here we have just added <parent> for making the project to inherit all the stuffs from the spring-boot-starter-parent. So now we have added spring-boot-starter-web, spring-boot-starter-data-redis, spring-security, jwt, jedis(redis) and lombok in our project which are essential dependency for starting our spring boot rest application with redis support.

Read the rest of this entry »

Tags: , , , ,

My experience of earthquake in Nepal

It was a nearly a middle of a day [Saturday April 25 2015] while me and my friend were talking about our last journey from Kathmandu(Nepal) to Raxaul(India) (friend’s brother’s wedding) and we were so tired as we returned back to Kathmandu just Friday. I was forcing my friend to get off from the bed and take a breakfast but suddenly I felt dizzy movement which was an earthquake, it was so quick with very high intensity of movement. I could easily decide that was a massive quake because there was a mass of crackling sound coming from around my house and those sounds were new to me. I grabbed one big pillow from bed and brought my friend to cover up with that big rectangular pillow. We were sitting side by side near by door frame with our knee down position covering our heads. We were having a tough moment at that time and convince each other for not getting panic. After that massive shake my father and elder brother came down to the ground floor where I am living, Everybody were so terrified by this first sudden quake, we were planning for staying at ground floor for next 5 minutes as it was not quiet safe to go out from home at that moment. I looked outside my window to see the condition and there were people running and I saw my bike fell down and quickly went outside to keep my bike in double stand position. The road way of my house was already cracked, my neighbor’s house also had cracks at the basement, I checked my house as well but it was not hurt.

Read the rest of this entry »

Tags: , , , , ,

TableView data selection by mouse press

Well It has been quiet long time but I found it would be time for me to blog small post about making the table cell selection in JavaFX. Normally TableView has facility to select the cell or row by using Ctrl,Command (Shortcut Key) and Shift button. You can easily select the data using your keyboards. But when it comes for ease to user interaction using mouse is vital. So today we will go through how to create selection of data by mouse. Lets categorize them in two parts. Read the rest of this entry »

Tags: , , , ,

ListCell Animation in ListView

After a long time I am back again with new stuffs. I have seen that JavaFX has got so many demand nowadays. Lots of people are requesting for something new something wow effect. In the same way one of my colleagues told me what if we have listview got some effects on scrolling the list. I got some dig around JavaFX Animation API and did some animation with ListCell but I thought it would be great if I share my works to you guys.

First We got to revamp what is the Listcell. ListCell are designed for making user to display text content in list format. But we can override these and make our own like displaying images,shapes and other controls as well.

ListCell inherits the character of Labeled so in default ListCell only displays the text content.If you want some control in your listcell other than label then there are some bunch of cellfactory in javafx.scene.control.cell package.

Every ListCell are being rendered according to the cellFactory implementation so you are free to implement your own cellFactory to make the listcell even more customizable. I had posted about TableCell customization which utilizes use of cellFactory (TableView Cell Modify)

Lets roll with the ListCell customization.
Read the rest of this entry »

Tags: , , ,

Lights in JavaFX 3D

It has been so long day that I have not blogged but today I am here with some new stuffs related to the JavaFX 3D. Before touching in JavaFX it is better to introduce some lights definition. There are many lights types but let not go more we are relating only two lights


  • JDK 8 EA build ver. 91 or later (or JDK8 General Release Version)

 Ambient Light 
An ambient light source represents a fixed-intensity and fixed-color light source that affects all objects in the scene equally. Upon rendering, all objects in the scene are brightened with the specified intensity and color. This type of light source is mainly used to provide the scene with a basic view of the different objects in it.

ambient lights javafx

Read the rest of this entry »

Tags: , , , , , ,