Skip to content
Advertisement

Tag: axios

AXIOS POST Response Fetch

I have a React ui which is supposed to communicate with the backend and fetch data. Backend works well and here is its response to my request: while I receive this error in my React for the same request. The url is the same, the parameters are in place but still there is an error and I am not able

Cannot invoke findByEmail because “this.userRepository” is null error

I keep receiving a Cannot invoke “com.***.repositories.UserRepository.findByEmail(String)” because “this.userRepository” is null error everytime I try to process my /register method. I can’t figure out why the code is coming across as null. Controller – Axios call – My UserRepository – Answer Simply add @Autowired to your related fields you want to get Autowired by spring. Change your code from to

react + spring boot upload file and form data

i have a case like in my form (front end), i can fill personal data (name, address, DOB) and then i can attach multiple image. In my spring boot controller : My model wrapper : Front end (React) Code : With above example, i always encounter errors. like : java.io.IOException: Stream closed and zero attachment length / zero attachment size

Advertisement