Petre Popescu

@ppopescu

885 Points

10 Followers

17 Posts

4 Answers

Joined February 15th, 2021

A Java Back-end Web Developer with a passion for coding

How to invalidate a compromised JWT

How to invalidate a compromised JWT

In a past article, I wrote about JWTs, how to generate one and how to use them for authorization. JSON Web Tokens, however, have one major drawback. Once it is generated and submitted to the client, it can’t be easily made invalid. This is a big problem if the JWT got leaked and it did not expire (or worse, it does NOT have an e...

Petre Popescu

1 week ago

6
Select One:
Handling Exceptions and Errors in Play Framework

Handling Exceptions and Errors in Play Framework

Article originally posted on my personal blog under How to handle Exception in Play Framework When programming, it is important to always take into consideration exceptions. No matter how well your code is, there can always be invalid data summited by the user problems in other libraries that can trigger exceptions. Also, using...

Petre Popescu

1 month ago

4
Select One:
How to make a custom message converter for Log4J2

How to make a custom message converter for Log4J2

Article originally posted on my personal website under Building a custom converter in Log4j2 I’ve been using Log4J for many years. It is a powerful logging library that is efficient and highly customizable. You can extend the functionality with ease and do custom actions on the message prior to it being logged. Without too much...

Petre Popescu

1 month ago

2
Select One:
Building a REST API in Play Framework

Building a REST API in Play Framework

Article originally posted on my personal website under Building a REST API in Play Framework. Sample requests can also be found there When building web applications, REST has become the most widely used approach because it is easy to use and easy to implement. In this tutorial I will be showing how to build a simple REST API in...

Petre Popescu

2 months ago

7
Select One:
Using “pepper” to increase password storing security

Using “pepper” to increase password storing security

Article originally posted o my personal website under How to securely store the password using a salt and pepper In a previous article I wrote how to securely store a password in the database. The article got the attention of many fellow developers and so I decided to improve it even more by writing this article. You see, even t...

Petre Popescu

2 months ago

8
Select One:
Using JSON Web Tokens for Authorization

Using JSON Web Tokens for Authorization

Article originally posted on my personal website under Using JWT in Java A useful feature of a web application is the possibility to authorize a client to access certain features of the app. Once authentication happens, it is important to also check that a client has access to the requested feature. An easy to use method is prov...

Petre Popescu

2 months ago

8
Select One:
The Story about 3 Interviews: Good, Bad and Ugly

The Story about 3 Interviews: Good, Bad and Ugly

I haven't changed jobs for about 4 years and I decided that it was time for either a change, or a substantial increase in my pay at the current company. I wasn't set on leaving my current job, but it is almost impossible to get more than 7% increase in salary without an offer from another company. I've been completely ignoring L...

Petre Popescu

2 months ago

1
Select One:
Optimizing jQuery DOM manipulation

Optimizing jQuery DOM manipulation

Article originally posted on my personal website at How to optimize jQuery DOM manipulation If you are working with JavaScript then most probably jQuery is a library you are using quite frequently. jQuery is useful and provides many features that are harder to achieve with basic JavaScript. Due to the fact that it usually runs o...

Petre Popescu

2 months ago

3
Select One:
Keep your code well organized. How I structure my web project

Keep your code well organized. How I structure my web project

Article originally posted on my personal website at How to organize your web project It is easy to get carried away and just write code. The code may even work as intended but trust me that, in 6 months time, you won’t know anymore what it does and where to find a specific functionality. Unless you have a clean and clear structu...

Petre Popescu

3 months ago

2
Select One:
Exposing sequential IDs is bad! Here is how to avoid it.

Exposing sequential IDs is bad! Here is how to avoid it.

Article originally posted on my personal blog: How not to expose your primary keys When working on LOGaritmical, I initially had my primary keys defined as UUIDs. I took this approach for two reasons: security and to avoid collisions even when there are many rows. My initial reasoning was that I will probably need to store each...

Petre Popescu

3 months ago

2
Select One:
Designing and Coding Event Management in Java

Designing and Coding Event Management in Java

An improved version and source code on my personal website: How to code events in Java A few years ago, back when ActionScript 3 was still used, but barely, I wanted to try game development in Java. All major game engines use other programming languages like C#, C++ or Lua, so it was a real pain to get started. That is when I di...

Petre Popescu

3 months ago

6
Select One:
Building a form in Play Framework

Building a form in Play Framework

Almost all websites require a form in one way or another. It can be as simple as a search field or a more complex form with many inputs and validation mechanisms. Either way, the main principles are the same and in this post, I will show you how to build a simple user registration form using Play Framework Java. We will cover al...

Petre Popescu

3 months ago

7
Select One:
Solution: The verse with the maximum number of appearances

Solution: The verse with the maximum number of appearances

Problem: Given a poem, with each verse on a new line, Find the verse (or verses) that have the maximum number of appearances and how many times it appears in the text. Solution: public static List<Pair> max2(String fullText) throws Exception { // If there is no text provided, throw an exception if (fullText...

Petre Popescu

4 months ago

Select One:
You should always do server-side validation! Always!

You should always do server-side validation! Always!

Original article with another example on my personal website Web technologies have evolved a lot in the past few years, both on the server-side as well as on the client’s side. There are many web frameworks, UI kits, JavaScript libraries and everything you need to easily and rapidly develop a website or web application. JavaScri...

Petre Popescu

4 months ago

4
Select One:
How to properly store a password in the Database

How to properly store a password in the Database

Article originally posted on my website un How to securely store the password in the Database When I started LOGaritmical, one of the first functionalities that I implemented was registering a new user. This meant that I had to store the user’s password in the database in a secure way and I will need to be able to verify that th...

Petre Popescu

4 months ago

2
Select One:
Simple Collection Manipulation in Java Using Lambdas

Simple Collection Manipulation in Java Using Lambdas

One of the most powerful features introduced in Java 8 was Lambda Even though at first it may not seem much, the new functionality speeds up both coding and execution in many cases, if used correctly. Here we will be looking over the power of Streams and Lambda expressions in Java and using them to do manipulations over collecti...

Petre Popescu

4 months ago

Select One:
How to use String UUID in Hibernate with MySQL

How to use String UUID in Hibernate with MySQL

When creating the database structure it is important to make sure that each row in a table has a unique ID so that it can be easily indexed, retrieved, and manipulated when needed. The most common methods are to use an auto-incremented column or a generated UUID. I won’t be covering the auto-incremented method since it poses no...

Petre Popescu

4 months ago

Select One:

Loading More Content