I am trying to map a User with a certain Table in a one to one relationship. This here is my code, id appreciate if u take a look at it: User class: The Table class: Answer You don’t mapped parent entity with child entity properly.In parent table object of CTable is currenTable and you mapped by with table. Change:
Tag: spring-mvc
How i return Empty mono if the request doesn’t return error using webClient
i want to know how return a empty Mono when i use webClient, i have this code and it works when the request return a user. Answer First of all, don’t use block() if you really want to take full advantage of using reactive stack. With it you are blocking the thread to wait for a response, don’t do that.
RedirectAttributes not working in SpringBoot project
I am trying to set up RedirectAttributes, but nothing happens when I do so. Here is my controller: This is a SpringBoot project, and since it is the Umbrella over Spring MVC, then I assumed I could use RedirectAttributes. So, what is going on? When I hit this end point, I am returned: redirect:uploadStatus Answer
Why can’t Postman find my Spring REST API?
I created a very basic Spring Boot project with REST APIs. I tried connecting it to my Angular app but it was getting some CORS security error so I switched to Postman. I’m trying to test it using Postman but I keep receiving a 404 not found error on Postman. Why am I not able to connect to my backend
How to properly define a Controller in Spring MVC compared to a JavaFX Controller
I’m having a hard time trying to understand the differences between a JavaFX Controller and a Spring MVC Controller. I came from a JavaFX background and I have seen many differences between a Spring MVC Controller vs a JavaFX Controller and I am currently working with Spring MVC. There are important differences between them, for example, in JavaFX, each fxml
SpringMVC with Bootstrap and Thymeleaf pages decoration
I am working in: “SpringMVC 5”, with “Twitter Bootstrap 4” html pages, and “Thymeleaf 3” templating, in IntelliJ EAP (latest version) and Tomcat9, Maven The structure of my project: I am using these tutorials: https://www.baeldung.com/spring-thymeleaf-fragments https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#template-layout I have my page (home.html). I have my template (template.html). According to the 2nd tutorial: I inserted the “menubar” into the “template” (this insert
Error while trying to upload file conversion types mismatch
I have folowing entety. One of the fields called file is to upload the document. And the controller function for this is as follows: But then I try to upload file and submit a form I am getting this exception Failed to convert property value of type ‘org.springframework.web.multipart.support.StandardMultipartHttpServletRequest$StandardMultipartFile’ to required type ‘java.lang.String’ for property ‘file’; nested exception is java.lang.IllegalStateException: Cannot
I getting an error while i am trying to update an user and not able to show my users roles using SpringBoot
what i am trying to do after logging in, in the usersPage, i am trying to show all users with their roles and when i click on edit on one of them i get to edit_user page which i will allow me to edit users but i get an error while am doing that and in the usersPage i can’t
JPA repository return one item from db but there are multiple item in the db
I have the following function in my repository When I use this function in the controller I got back one User. For example, if I have a String “John” and I call the repo function with that string I got back “John Doe” but I also have “John Doe Jr” in the db and I need him too. Why I
Spring with Jackson set JsonAutoDetect globally
In my spring boot web application, I want to serialize many different classes to JSON when I return them from the function of a request mapping. These classes only contain private fields without getters. In order for Jackson to serialize these private fields I can annotate all those classes with the following annotation, which works perfectly fine as expected. But