Inject Multipart file as DTO into Spring Controller

Suppose you have a Sprint controller which accepts a multipart Excel file, which you need to parse and process. One way doing this is adding a Multipart argument to your controller method, using a library like apache poi to parse the excel file and extract data from it, and finally to do something with the data. Wouldn’t it be nice if the Excel data were passed into your controller method as a DTO, instead of a multipart file, this way you wouldn’t have to worry about parsing the excel file yourself.

Read More

ABAC using spring security

Recently I’ve been investigated the ways I can use spring-security to clean up the authorization code in one of our applications. Currently the access control code is spread out all over the code base. And it’s a mess.

Read More