Why is it thread-safe after service is injected into controller in springmvc?

it is said that springmvc is thread-safe. I know that stateless objects must be thread-safe. But when Service is injected into Controller, it becomes a stateful object . Is it still thread-safe?

//
public class UserController {
    
}

//
public class UserController {

    int a;
    
}

//?????
public class UserController {

    @AutoWired
    private UserService userService;
    
}

I hope the person who knows it will solve the problem for my younger brother. Thank you!
add: I know about ThreadLocal and single-case multiple cases (scope=prototype). I just want to know the stateless and stateless situations I described above.


you don't know what thread safety means. UserService itself is not thread-safe. Do you modify userService in userController? Just call the method in userService, right? Methods are thread-safe, and multithreading calls an instance's method and copies variables in memory, so as long as you don't modify the userService instance in userConstroller.


@ Controller's default singleton pattern


the service, you inject yourself requires you to ensure thread safety. Spring can't help you do this.


the injected bean itself is singleton.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b34b0e-4d5d1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b34b0e-4d5d1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?