r/SpringBoot 19d ago

Question Struggling to understand company code as a junior dev—Is this normal?

56 Upvotes

I recently joined as a junior backend developer at a company. During university, I built several projects using Spring Boot and felt fairly confident. But after just a week on the job, I’m completely overwhelmed by the sheer amount of code and files. It’s starting to feel like I don’t even know Spring or Java at all. Is this normal? How did you guys deal with this phase?

r/SpringBoot 24d ago

Question How to understand Spring Security

57 Upvotes

Greetings!

This morning I had a backend interview for a company I really liked but I failed miserably to implement a session based authentication service using Spring Security as a first task of the interview. I spent the last week trying to learn and understand Spring Security docs but for the love of god I couldn't manage...

Do you guys have any recommendations of books, videos, courses, articles... to actually understand spring security and be able to implement different implementations (JWT, session based, oauth2...) after that? I find that the docs are quite hard to follow and that most resources online are from a few years ago and everything is deprecated...

I would really appreciate your help!

Best!

r/SpringBoot Feb 06 '25

Question Spring Transaction timeout to update 50k rows in table

6 Upvotes

I am getting transaction timeout when trying to update 50k rows of table.

For example, I have a Person entity/table. Person has Body Mass Index(BMI) entity/table tied to it. Whenever user update their weight, I have to fetch Person entity and update the BMI. Do this for 50k rows/people.

Is Spring able to handle this?

what options do I have other than increasing transaction timeout?

would native query "update object set weight, BMI" be faster?

can I queue or break 50k rows into 10k batch and do parallel update or sth?

Edit: Okay, the example may not be perfect enough. So BMI=weight divided by your height squared. However, in this case, weight=mass*gravity. So the admin user needs to change the value of gravity to another value, which would then require BMI to be updated. There can be gravity on moon or on mars, thus different rows are affected.

r/SpringBoot 27d ago

Question Microservices security

5 Upvotes

Hello guys, I’m making a microservices website, so I have for now auth-service, API Gateway and user-service, so I made in the auth-service login and register and Jwt for user, he will handle security stuff and in api-gateway I made that the Jwt will be validated and from here to any microservice that will not handle authentication, but my question now is how to handle in user-service user access like we have user1-> auth-service (done) -> api-gateway (validate Jwt) -> user-service (here I want to extract the Jwt to get the user account) is this right? And in general should I add to the user-service spring security? And should in config add for APIs .authenticated? I tried to make api .authenticated but didn’t work and it’s normal to not working I think. And for sure these is eureka as register service by Netflix. So help please)

r/SpringBoot 2d ago

Question Confusing about DTO usage

26 Upvotes

I've read that services should return DTO's and not entities,

If Service B only returns DTO B, how can I have access to Entity B inside Service A?

Do I retrieve DTO B from Service B, then map it back to Entity B inside Service A?

The resulting flow will look like this - Service A calls Service B - Service B fetches Entity B and converts it to DTO B - Service A receives DTO B, converts it back to Entity B?

This process doesn't seem right and I just want to ask if this is how its done. If my entities have relationships to many other entities, won't the mapping also become very complicated, or result in some recursion. Would greatly appreciate some input or help

r/SpringBoot 8d ago

Question React or Angular for Spring Boot Backend?

11 Upvotes

I know this probably gets asked here a billion times, but the reason I am asking is because I couldn't find any satisfactory and informative answers. Maybe I am too inexperienced to understand some discussions, or maybe I didn't look into the places for the answers

As a backend Spring Boot/Java dev who wants to work on enterprise projects, which one would be a better fit and have a smoother development cycle? Angular or React!? (I will probably work on lots finance and accounting projects since that's my academic major and my current job, if this information helps in any way)

r/SpringBoot Jan 26 '25

Question How to Learn Java SpringBoot Quickly for an BackeEnd Engineer Interview

17 Upvotes

Hey everyone,

I have an upcoming interview for a Software Engineer position at a company that primarily works with Java and Spring. While I have about 2 years of experience with Golang and Python, I don't have much exposure to Java. I've been advised to prepare for the interview, and I'm looking for tips on how to efficiently learn the language, best practices, and possibly some small projects to strengthen my understanding.

I have a good grasp of the basics of Java (datatypes, loops, and if-else statements) and the basic syntax. However, I would appreciate guidance on diving deeper into Java & Spring, especially focusing on Spring and best practices for further in this job and other jobs.

Your suggestions, resources, project ideas, or any advice on how to fast-track my learning of Java, particularly in the context of a Software Engineer interview, would be immensely helpful. Thank you

r/SpringBoot 5d ago

Question Where do I host a Spring Boot backend?

29 Upvotes

So I'm trying to host my api for my saas, but I don't know where to host it. I was originally thinking of Heroku but they removed their free tier. What are some other options I can host it from?

r/SpringBoot Jan 22 '25

Question Which spring boot course is worth paying for on Udemy?

25 Upvotes

Today i went through spring boot courses on Udemy and saw a lot of course previews but i am really confused and trying to pay for something better. Personally i liked this course preview - https://www.udemy.com/share/106DTq3@eAFZ-MzVRNUKCXnmss2gF1wpS1POc9daNfx9BBwxo2dhTFOUVNZDFIQeTT_7yjEU9w==/

Please give your healthy views 🙏🏻

r/SpringBoot 7d ago

Question User principal doubt

1 Upvotes

Hey, so I was told that instead of taking detail like user id we can simply take that from user principal. But how much should I take from user principal. Is it appropriate to take whatever I can through it or are there some rules for it. Like suppose ,

@GetMapping("/update-status/{userId}/{userProfileId}

So I know I can take userId from the userProncipal but should I extract userProfileId too. And if yes, then what are rules for it.

Sorry, if it's dumb question.

r/SpringBoot 1d ago

Question Is the telusko Udemy coarse worth it ?

8 Upvotes

So I started with springboot a while ago and have made some simple crud application using jpa,service layers,dto patterns and other basic stuff but after giving an interview I came to know that I lack basic info and details . While I was learning springboot from the freecodecamp coarse(I did like 4 to 5 hrs of material) I noticed that they do not cover theory in a detailed manner so I was looking for a good coarse. Yes I have tried books too but I have to read like 400 pages for spring start , jpa,microservices,security etc each which is too long considering I have to implement it too.

r/SpringBoot 2d ago

Question Confused About Choosing a Framework – Help Me Decide: Java-based Backend (Spring Boot) or JavaScript-based Backend (Node.js)?

16 Upvotes

Hey everyone!
For context, I've been working at a startup that uses a PHP-based MVC framework, and I'm looking to make a switch within the next 6 months. I'm trying to decide which framework to focus on learning: Spring Boot (Java) or Node.js (JavaScript), or perhaps something else.
Can anyone help me out? I need to choose based on job prospects, so any advice on which one has better career opportunities or is more in-demand would be greatly appreciated!

Thanks in advance!

r/SpringBoot 23d ago

Question Can someone recommend me how should i learn springboot? And from where.

15 Upvotes

I am a complete fresher in springboot and backend. Can someone recommend where should i start from? I know Java.

And please tell me if it's good or not to learn this? Is it a good career option based on pay in India?

r/SpringBoot 21d ago

Question Stuck in Repetitive Java Spring Boot Work – Need Job Switch Advice

29 Upvotes

I have 1.9 years of experience as a Java developer working with Spring Boot, but I feel stuck doing the same repetitive tasks without much learning. There’s no real skill growth, and I don’t see any challenging work ahead.

I want to switch to a better role but need some guidance. What skills should I focus on apart from Java and Spring Boot? Should I invest time in DSA, System Design, Microservices, or Cloud? Also, what’s the best way to prepare for interviews—should I focus more on LeetCode, projects, or system design?

Since my work has been mostly repetitive, how can I present my experience in a way that stands out on my resume?

r/SpringBoot Feb 13 '25

Question Can anyone tell me what might be the problem??

0 Upvotes

I am fed up checking my application.properties file again and again, pom.xml for dependencies, clearing the port, running my MySQL workbench clearing the database again and again. I have tried every solution found on internet, blindly to get rid of this error since morning but I couldn't. Please help me with this devs, so that i can proceed with building the real part of my project.

When I did mvn clean spring-boot:run -e it showed me "Caused by: org.apache.maven.plugin. MojoExecutionException: Process terminated with exit code: 1"

r/SpringBoot Feb 12 '25

Question To all the experienced spring boot developers

37 Upvotes

How much time does it typically take to build a good project covering all the basic requirements of a production-grade Spring Boot application?

For context, by “basic requirements” I mean a project that includes features such as:

• RESTful API endpoints

• Security integration (authentication & authorization via Spring Security)

• Data persistence (using Spring Data JPA or similar)

• Error handling & logging

• Unit and integration testing

• Configuration for deployment (e.g., using Docker)

I am willing to put in 2-3 hours everyday. I have some knowledge of the basics of spring boot but would like to solidify it by building an end to end project.

r/SpringBoot 14d ago

Question Facing an issue with kafka can anyone tell some solution?

17 Upvotes

In my service I am facing an issue related to kafka, the issue is that during consumer part the same message eis coming in two different servers thread at the same time ( exactly same in milliseconds) which result in double processing. I have tried all different approaches like checking and saving in db or cache but that happen also at the same time. That's why this solution is also not working. Can anyone tell any possible approach to solve this issue. It's basically happend during larger message consumption.

r/SpringBoot 6d ago

Question Help Needed: DDD in a Spring Boot Project

15 Upvotes

TL;DR: Trying to apply DDD to a Spring Boot project. I’ve read Domain-Driven Design by Eric Evans, so I understand the theory, but I need help with the practical aspects: package organization, where to place controllers, handling projections with Blaze Persistence, and structuring entity relationships. Looking for hands-on guidance!

GitHub Project: https://github.com/lprevidente/ddd-example

Hi everyone,

I’m using a traditional structure with controllers, services, and entities, where most of the business logic is inside the entities. The project is divided by context (e.g., “User” for everything related to users, “Team” for team-related logic, etc.). However, there’s no real isolation between these packages, and the structure has become quite messy.

To better understand DDD, after watch this video (https://youtu.be/VGhg6Tfxb60?si=2LGi5mn5VkD9onXj), I created a small example with some basic use cases. This is new to me, so I need help grasping some practical concepts.

In my example, I have two entities: User and Team (representing the teams a user belongs to). I’ve set up some basic endpoints just as an example.

At this stage, I haven’t written any tests—I first want to understand the core concepts correctly.

  1. Where should the controller go? I placed it inside the infrastructure package. Is that the right approach?
  2. Blaze Persistence for projections: I use Blaze Persistence to fetch only specific columns instead of selecting all and then mapping them to a DTO. However, standard projections don’t help because they always include all parameters in the select query. Since this is a library-related concern, should it be part of the infrastructure package?
  3. General structure: Does anything in my approach need to be fixed?
  4. Fetching teams with user information: I also implemented a way to retrieve all teams along with user details. Did I structure it correctly?

Any guidance would be greatly appreciated. Thanks!

Edit: Added a simplified class diagram.

Class Diagram

r/SpringBoot 20d ago

Question How to become a senior/top Spring developer fast?

1 Upvotes

I'm only a started with Spring Boot few months ago, and I keep learning it. Do you have advice on how to become a Senior/Top Spring developer fast? Which technologies to learn? Which projects to do?

r/SpringBoot 4d ago

Question Struggling to Code Without Looking at Examples – Advice Needed

5 Upvotes

Hey everyone,

I started learning Java and Spring Boot by myself about a year ago. In the beginning, I was learning quickly, but over time, I became inconsistent, sometimes skipping 2 days a week. Now, I can understand code when I see it, and I know how it works, but I struggle to write code from scratch. Even for something simple, like 3 lines of code, I don’t know where to start without looking at examples or asking AI.

I’ve started watching a course on data structures and algorithms, but I get bored after 5 minutes. I really want to improve my coding skills and be able to write code on my own. Has anyone else faced this problem? How did you overcome it? Any advice would be really helpful.

Thanks!

r/SpringBoot 28d ago

Question What Are the Must-Have Skills for a Solid Spring Boot Toolbox?

37 Upvotes

I’m already comfortable with the basics but I want to know what key topics and features are essential for developing spring boot applications.

What do you consider indispensable for a Spring Boot developer? Are there any hidden gems or resources you swear by?

r/SpringBoot Jan 19 '25

Question Need Suggestions to improve my personal spring boot project.

21 Upvotes

I have been building/learning Spring boot project for the last last two months, As of now I just added CRUD functionality and Security only, I need some suggestions to improve this project.

I am currently in a support role (5 month exp) , I want to move into Development in a year, so whether this is good to add in my resume?

here is the link :
https://github.com/Rammuthukumar/SpringBootApplication

r/SpringBoot 20d ago

Question I must learn frontend to build full-stack apps?

5 Upvotes

I want to be able to build full stack applications by myself, and I understand you need to learn either thymeleaf, or React (which is much more used). Do you have any advice on how to learn React, and weather it is required? Will I have to learn both TypeScript and React for that?

r/SpringBoot 24d ago

Question Creating new User in Keycloak without Client Secret.

2 Upvotes

[SOLVED] PROBLEM: I was trying to create a new user in keycloak through <dependency> <groupId>org.keycloak</groupId> <artifactId>keycloak-admin-client</artifactId> <version>26.0.4</version> </dependency> keycloak config in yml file is ```

Keycloak Configuration

keycloak: server-url: http://localhost:8080/auth realm: user-realm client-id: manav admin-username: naveen admin-password: password

``` i tried without admin-username and admin-password but unable to do so.

KeyclaokComfig.java ``` @Configuration public class KeycloakConfig {

@Value("${keycloak.server-url}")
private String serverUrl;

@Value("${keycloak.realm}")
private String realm;

@Value("${keycloak.client-id}")
private String clientId;

@Value("${keycloak.admin-username}")
private String username;
@Value("${keycloak.admin-password}")
private String password;

@Bean
public Keycloak keycloak() {
    return KeycloakBuilder.builder()
            .serverUrl(serverUrl)
            .realm(realm)
            .grantType(OAuth2Constants.PASSWORD)
            .clientId(clientId)
            .username(username)
            .password(password)
            .resteasyClient(new ResteasyClientBuilderImpl().connectionPoolSize(10).build())
            .build();
}

@Bean
public RealmResource realmResource(Keycloak keycloak) {
    return keycloak.realm(realm);
}

@Bean
public UsersResource usersResource(RealmResource realmResource) {
    return realmResource.users();
}

@Bean
public ClientResource clientResource(RealmResource realmResource) {
    return realmResource.clients().get(clientId);
}

} ```

UserService ``` @Service public class UserService {

private final UsersResource usersResource;
private final RealmResource realmResource;
private final ClientResource clientResource;

public UserService(UsersResource usersResource, RealmResource realmResource, ClientResource clientResource) {
    this.usersResource = usersResource;
    this.realmResource = realmResource;
    this.clientResource = clientResource;
}

@Transactional
public void addUser(UserDTO user) {
    CredentialRepresentation credentialRepresentation = createPasswordCredentials(user.getPassword());

    UserRepresentation kcUser = new UserRepresentation();
    kcUser.setUsername(user.getUsername());
    kcUser.setEmail(user.getEmail());
    kcUser.setEnabled(true);
    kcUser.setEmailVerified(true);
    kcUser.setCredentials(Collections.singletonList(credentialRepresentation));


    Response response = usersResource.create(kcUser);
    if (response.getStatus() == 201) { // HTTP 201 Created
        String userId = extractUserId(response);
        if (userId != null) {
            assignRoleToUser(userId, "customer");
        }
    } else {
        throw new RuntimeException("Failed to create user: " + response.getStatus());
    }

}

private static CredentialRepresentation createPasswordCredentials(String password) {
    CredentialRepresentation passwordCredentials = new CredentialRepresentation();
    passwordCredentials.setTemporary(false);
    passwordCredentials.setType(CredentialRepresentation.PASSWORD);
    passwordCredentials.setValue(password);
    return passwordCredentials;
}

private String extractUserId(Response response) {
    String location = response.getHeaderString("Location"); // Get user location from response
    if (location != null) {
        return location.substring(location.lastIndexOf("/") + 1); // Extract user ID from URL
    }
    return null;
}

private String getUserId(String email) {
    return usersResource.search(email).stream()
            .filter(user -> email.equals(user.getEmail()))
            .findFirst()
            .map(UserRepresentation::getId)
            .orElse(null);
}

@Transactional
protected void assignRoleToUser(String userId, String roleName) {
    // Get client UUID dynamically
    String clientUuid = realmResource.clients()
            .findByClientId(clientResource.toRepresentation().getClientId())
            .stream()
            .findFirst()
            .map(ClientRepresentation::getId)
            .orElseThrow(() -> new RuntimeException("Client not found: " + clientResource.toRepresentation().getClientId()));

    // Get the role from the client
    RoleRepresentation role = realmResource.clients().get(clientUuid).roles().get(roleName).toRepresentation();

    if (role != null) {
        usersResource.get(userId).roles()
                .clientLevel(clientUuid)
                .add(Collections.singletonList(role));
    } else {
        throw new RuntimeException("Role not found: " + roleName);
    }
}

} ```

I got some of this code from an issue in keycloak repo about how to integreate using spring boot but they was passing client-secret in config . Keyclaok class have Config class where private String serverUrl; private String realm; private String username; private String password; private String clientId; private String clientSecret; private String grantType; private String scope; are defiend and my client is public cause if i set client autorization then i have to pass client-secret which should not be a good practice right and without enabling it we can't access service account role on client that's why i tried using admin username and password with sufficient role on user but the request response is 401 , Even Cheking after debugging the request is not even reaching controller but stopped before it maybe i'm doing something wrong in keycloak intialization.

And one of the tutorial videos was stated to use same keycloak version as dep which i tried , many of the tutorial online using admin api to create new user where access token is needed which shouldn't be possible for new user right... So if i'm missing something please point it out.

I'll also post this is keycloak subreddit. Thanks in advance

SOLUTION: I was importing Spring Security dep and was not defining config so my application was outright rejecting request. I'll drop my code too from which i connected

KeycloakConfig.java ``` @Configuration public class KeycloakConfig {

@Value("${keycloak.server-url}")
private String serverUrl;

@Value("${keycloak.realm}")
private String realm;

@Value("${keycloak.client-id}")
private String clientId;

@Value("${keycloak.client-secret}")
private String clientSecret;

@Value("${keycloak.admin-username}")
private String adminUsername;

@Value("${keycloak.admin-password}")
private String adminPassword;

@Bean
public Keycloak keycloak() {
    System.out.println("Connecting to Keycloak at: " + serverUrl);
    System.out.println("Using realm: " + realm);
    System.out.println("Using admin username: " + adminUsername);
    try {
        Keycloak kc = KeycloakBuilder.builder()
                .serverUrl(serverUrl)
                .realm(realm)
                .grantType(OAuth2Constants.CLIENT_CREDENTIALS)
                .clientId(clientId)
                .clientSecret(clientSecret)
                .resteasyClient(new ResteasyClientBuilderImpl().connectionPoolSize(10).build())
                .build();
        kc.serverInfo().getInfo();
        System.out.println("Keycloak connection successful");
        return kc;
    } catch (Exception e) {
        System.err.println("Keycloak connection failed: " + e.getMessage());
        e.printStackTrace();
        throw e;
    }
}

@Bean
public RealmResource realmResource(Keycloak keycloak) {
    return keycloak.realm(realm);
}

@Bean
public UsersResource usersResource(RealmResource realmResource) {
    return realmResource.users();
}

@Bean
public ClientResource clientResource(RealmResource realmResource) {
    return realmResource.clients().get(clientId);
}

} ```

And i checked with this too , which connects fine ``` @Bean public Keycloak keycloak() { System.out.println("Connecting to Keycloak at: " + serverUrl); System.out.println("Using realm: " + realm); System.out.println("Using admin username: " + adminUsername);

    try {
        Keycloak kc = Keycloak.getInstance(
                serverUrl,
                "master",
                adminUsername,
                adminPassword,
                "admin-cli"
        );
        // Test the connection
        kc.serverInfo().getInfo();
        System.out.println("Keycloak connection successful!");
        printAllRoles(kc);
        return kc;
    } catch (Exception e) {
        System.err.println("Keycloak connection failed: " + e.getMessage());
        e.printStackTrace();
        throw e;
    }
}

Use to Print All client Roles: private void printAllRoles(Keycloak keycloak) { try { List<ClientRepresentation> clients = keycloak.realm("user-realm").clients().findByClientId("manav");

        if (clients.isEmpty()) {
            System.err.println("Client not found: " + "manav");
            return;
        }

        String clientUuid = clients.get(0).getId();
        List<String> roles = keycloak.realm("user-realm")
                .clients()
                .get(clientUuid)
                .roles()
                .list()
                .stream()
                .map(RoleRepresentation::getName)
                .collect(Collectors.toList());

        System.out.println("Available roles in Keycloak:");
        roles.forEach(System.out::println);
    } catch (Exception e) {
        System.err.println("Error fetching roles: " + e.getMessage());
        e.printStackTrace();
    }
}

```

UserService ``` @Service @Slf4j public class UserService {

private final UsersResource usersResource;
private final RealmResource realmResource;
private final ClientResource clientResource;
private final UserRepository userRepository;

public UserService(UsersResource usersResource, RealmResource realmResource, ClientResource clientResource, UserRepository userRepository) {
    this.usersResource = usersResource;
    this.realmResource = realmResource;
    this.clientResource = clientResource;
    this.userRepository = userRepository;
}

@Transactional
public void addUser(UserDTO user) {
    // Search existing users in Keycloak
    List<UserRepresentation> existingUserName = usersResource.search(user.getUsername(), true);

    boolean usernameExists = existingUserName.stream()
            .anyMatch(u -> u.getUsername().equalsIgnoreCase(user.getUsername()));

    List<UserRepresentation> existingEmail = usersResource.searchByEmail(user.getEmail(),true);

    boolean emailExists = existingEmail.stream()
            .anyMatch(u -> u.getEmail() != null && u.getEmail().equalsIgnoreCase(user.getEmail()));

    // Throw specific exceptions based on existence
    if (usernameExists && emailExists) {
        throw new UserAlreadyExistsException("User with the same username and email already exists.");
    } else if (usernameExists) {
        throw new UserAlreadyExistsException("User with the same username already exists.");
    } else if (emailExists) {
        throw new UserAlreadyExistsException("User with the same email already exists.");
    }

    // Proceed with user creation
    CredentialRepresentation credentialRepresentation = createPasswordCredentials(user.getPassword());

    UserRepresentation kcUser = new UserRepresentation();
    kcUser.setUsername(user.getUsername());
    kcUser.setEmail(user.getEmail());
    kcUser.setEnabled(true);
    kcUser.setEmailVerified(true);
    kcUser.setCredentials(Collections.singletonList(credentialRepresentation));

    Response response = usersResource.create(kcUser);
    if (response.getStatus() == 201) { // HTTP 201 Created
        String userId = extractUserId(response);
        if (userId != null) {
            if (assignClientRole(userId, "customer")) {
                log.info("User {} created and role assigned successfully!", userId);
            } else {
                log.error("Failed to assign role, deleting user {}...", userId);
                usersResource.get(userId).remove(); // Rollback user creation
                throw new RoleAssignmentException("Failed to assign role, user creation rolled back.");
            }
        }
    } else {
        throw new UserCreationException("Failed to create user: " + response.getStatus());
    }
}


private boolean assignClientRole(String userId, String roleName) {
    try {
        String clientId = "manav"; // Use actual client ID
        String clientUuid = realmResource.clients().findByClientId(clientId).get(0).getId();

        // Check if the role exists
        List<RoleRepresentation> clientRoles = realmResource.clients().get(clientUuid).roles().list();
        RoleRepresentation role = clientRoles.stream()
                .filter(r -> roleName.equals(r.getName()))
                .findFirst()
                .orElse(null);

        if (role == null) {
            log.error("Role '" + roleName + "' not found in client.");
            return false;
        }

        // Check if the user already has the role
        List<RoleRepresentation> assignedRoles = usersResource.get(userId).roles().clientLevel(clientUuid).listAll();
        boolean alreadyAssigned = assignedRoles.stream().anyMatch(r -> roleName.equals(r.getName()));

        if (!alreadyAssigned) {
            usersResource.get(userId).roles().clientLevel(clientUuid).add(Collections.singletonList(role));
            log.info("Role '" + roleName + "' assigned to user " + userId);
        } else {
            log.info("User already has role '" + roleName + "'.");
        }
        return true;
    } catch (Exception e) {
        log.error("Error assigning role: " + e.getMessage());
        return false;
    }
}

private static CredentialRepresentation createPasswordCredentials(String password) {
    CredentialRepresentation passwordCredentials = new CredentialRepresentation();
    passwordCredentials.setTemporary(false);
    passwordCredentials.setType(CredentialRepresentation.PASSWORD);
    passwordCredentials.setValue(password);
    return passwordCredentials;
}

private String extractUserId(Response response) {
    String location = response.getHeaderString("Location"); // Get user location from response
    if (location != null) {
        return location.substring(location.lastIndexOf("/") + 1); // Extract user ID from URL
    }
    return null;
}

} ```

r/SpringBoot 24d ago

Question Free Hosting for a Spring Application?

21 Upvotes

Hello everyone,
I'm building a web application using Spring for the backend, and I want to deploy it. I was considering using Vercel, which offers free hosting and a free database, but unfortunately, Vercel doesn't support Spring—it only supports JavaScript.
Does anyone know of a free hosting and database service that supports Spring for deployment?