Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
4 votes
2 answers
433 views

Springboot - Authentication Service

I am developing a Web application using Spring boot (I am a beginner). How can I make my code better? This code is from "AuthenticationService.java". I first made an interface for defining ...
RudraSama's user avatar
1 vote
2 answers
1k views

Using Factory Design Pattern in Rest Controller of Spring

I used factory design pattern to identify the service according to the enum that comes from the api uri as request param. Everything seems okay according to me but cannot be sure if I used it right. <...
Abdu Muhammadal's user avatar
3 votes
1 answer
113 views

A controller for a Game Service

I have a Spring MVC controller but I'm not sure that it is a good or bad design. As far as I know, api versioning is missing but apart from that I implemented Swagger for documentation and added ...
Burak's user avatar
  • 31
1 vote
1 answer
3k views

Spring boot: better way to handle response and exceptions

I am working on a quite a big Spring Boot web service and I wanted a standardized and simplified way to handle responses and exceptions by following fluent API design. So this is what I did and it ...
benjamin c's user avatar
0 votes
1 answer
140 views

Microservice in Springboot

I wrote two microservices in Springboot and tried to follow the best practices. I would appreciate any suggestions about any improvement that I can make on the whole codebase. What are the parts of ...
forhadmethun's user avatar
1 vote
1 answer
186 views

In Spring framework, should the controller let the client know that something went wrong by returning a response entity with the proper error code?

Category Service: ...
Alexandros Kourtis's user avatar
13 votes
2 answers
2k views

Stack Overflow clone

I have to write a simple web application using the Java Spring framework as my course project. So I decided to write a simple Stack Overflow clone. My application has the following features: ...
eanmos's user avatar
  • 405
4 votes
2 answers
14k views

Return a 404 when a resource is not found in Spring Boot

I wrote this code in order to return a http status of not found to my users in case the resource is not present in the DB. ...
Pitto's user avatar
  • 829
14 votes
4 answers
3k views

Unit testing Video Service class

I wrote my first unit testing code on a service class using Mockito. The code looks like this: ...
Patrick's user avatar
  • 341
4 votes
1 answer
30k views

Simple Banking application in Spring boot, JPA, REST where balance can be transferred among predefined accounts and transaction history retrievable

I want to create a very simple banking application where (i) predefined accounts with a positive balance can send money (ii) requesting balance and a list of transactions can be found. I have ...
forhadmethun's user avatar
3 votes
1 answer
3k views

Effective & Secure Method to populate Access Token for authorization header in Rest Template

I am trying to consume a REST endpoint by using the RestTemplate Library provided by the spring framework. The endpoint also demands a Bearer Access Token as its authorization header, which is only ...
Nithin's user avatar
  • 131
0 votes
1 answer
68 views

Spring Boot methods to add and remove relationships

I have a Spring Boot application and I wrote a piece of code to manage relationships between two entities. The code consists mostly in these two methods: ...
lch's user avatar
  • 103
1 vote
2 answers
148 views

Reporting sums of shopping carts

I have an object (ShoppingCart) that has a list of CartItems, which contains the related ...
fsakiyama's user avatar
  • 111
2 votes
1 answer
6k views

CSV file download in Spring

I recently worked on a module, in which I implemented the functionality of downloading the CSV files. ...
user10753505's user avatar
0 votes
1 answer
86 views

Refactor REST service with overcomplicated logic

Need to perform such actions: receive JSON from REST extract nexted JSON document calculate hash of the nested document add some fields to extracted document and save it in database return response ...
typemoon's user avatar
  • 183

15 30 50 per page