Skip to content
Advertisement

Tag: spring-boot

post method not supported in patch method

I want edit entity with validating by hibernate-validator, but when calling the patch method, an error is thrown: post method not supported. How to make @PatchMapping work correctly? I am a beginner developer, help me please. Controller: Service: Repository: html form: Answer you can not use ‘PATCH’ for the form method attribute. only ‘GET’ and ‘POST’ methods are allowed(source).

how do i save a new student that contains entities, but don’t create these entities because they already exist in the database?

I want to save a student and a student has a TargetAudience object as an attribute. These target audiences are allready hardcoded in my database. (targetaudience = campus + major). Now when i post like this: it doesnt work because everythime it creates a new object for the campus and because i use name as a primary key it throws

How to copy object that has a list with BeanUtils?

I’m working on a multi maven modules and I want to copy from entity to model with BeanUtils, here what I tried: This is my entity (with getters/setter/noargs/allargs): and this is my model (DTO Model): This is the output I’m getting: The problem is that the fields get copied but the list does not it shows me an empty List.

How to add @RestController to spring-webflux apps?

The annotation @RestController cannot be resolved when only adding spring-boot-starter-webflux as maven dependency: pom.xml: What is missing here? According to many resources out there (eg https://medium.com/javarevisited/basic-introduction-to-spring-webflux-eb155f501b17), the webflux dependency should be sufficient for a webflux-webservice in spring-boot. Answer RestController annotation is part of org.springframework:spring-web: dependency org.springframework:spring-web dependency is part of org.springframework.boot:spring-boot-starter-webflux jar so it should get resolved. You can check

Advertisement