Skip to content
Advertisement

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

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

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

Advertisement