Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 11 months ago. Improve this question I want to build something like this. From a k value and Map<String,List> I want to build a scoring system, the k value is the
Tag: model-view-controller
Redirect to another page with @RequestBody
I’m struggling with something. i pass JSON data to my controller In my RestController, i handle this information like this saving the JSON elements into the object myRequest. The thing is, having @RequestBody forces me to stay in that JSP, but i want to after processing this information, redirects to another page. Tried with various ways to redirect but the
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
correct structure in MVC with spring
I’m a little confused about correct mvc pattern. This is my config file: In this class I’ve got all Beans. This is my interface UserRepo, and interface UserService. They are the same I’ve got my class that implemets this interface And finally I’ve got my Controller In my Controller I @Autowired UsersRepo/it’s a inteface/. And my code works, I can
How to print Java object in modal using jQuery
I am trying to print object data in modal using jQuery. When I click the button it sends the Java object to jQuery and then prints it but it is printing in this format: Trip [tid=1, tname=North, tplace=Ladhak, tpackage=12000, tfrom=2022-05-21, tto=2022-05-31, lastdate=2021-12-22, tinfo=XYZ] I want to access data of the object and display it. jQuery code: Answer Split your data
Spring cannot create UserService bean
Dao tier. I have abstract jpa dao interface, extended interface, and I added abstract implementation, from which I extend other real used implementations. These classes as follows: Service tier. Here I also have abstract service interface, one extended interface (UserService) and its abstract and real implementations: In my real project I got many extended interfaces from AbstractDao and AbstractServie. You
Java code exporting workbook to current user PC instead of the actual web app host
I have a spring MVC project that I have develop for my team at work. I have an endpoint that create a workbook using apache poi, then export to .xlsx file, but my code appeared to write to file on the application host instead of user’s computer. I know I’m missing something, but I try what I found on internet
How to properly use 3 – layers architerchture in Spring MVC – Java
I come before you with a confusion that, perhaps, you can clarify to me. I’m learning now how to use 3-layers architecture with Spring MVC (using Repository, Service, Controllers), but I don’t understand the following things and how I should do it: -Service Layer, here, I do not understand, the methods defined in the interface should be the same as
is there any way to fetch data from many to many tables using spring without infinite json format?
user entity board entity When I try to fetch data using findAll method I get infinite json object. For example when I fetch users I have set of boards inside it I have set of users and inside it I have set of boards… etc. How can I fetch user with his boards and boards with its users ? Answer
Dynamic HTML in Thymeleaf
I am creating a Spring MVC + Thymeleaf project. I would like the user to have control over some parts of the page, meaning that user could change text and format is as well with colors, font sizes, etc., using HTML tags. However, I have not found any way how to insert dynamic HTML into thymleaf HTML template. Is there