Serverless using Java
My colleague were just discussing about the new architecture serverless most of the time and out of curiosity I fiddle around with this term and… Read More »Serverless using Java
Narayan Gopal Maharjan is a 22 years old software developer, living in the Kathmandu, Nepal and currently under-graduating on software engineering.He has keen interest at Java and Javafx programming , he started programming from his high school age and he develops software on Web(JavaEE), Desktop(Java Swing,Java FX), Mobile(Android) devices.
My colleague were just discussing about the new architecture serverless most of the time and out of curiosity I fiddle around with this term and… Read More »Serverless using Java
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 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.7.RELEASE</version> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> <groupId>io.jsonwebtoken</groupId> <artifactId>jjwt</artifactId> <version>0.7.0</version> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> </dependency> <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> </dependency> </dependencies> |
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.
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.
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 More »TableView data selection by mouse press
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 More »ListCell Animation in ListView