Skip to content
Advertisement

Tag: spring-mvc

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

Spring Boot 2 Multiple Datasource – work only the one with @Primay annotation

I have a problem, I’m trying to use two Oracle databases in spring boot using DataSource, The DataSource wiht the @Primay annotation works fine but the oher one only gives me: I don’t have idea what I should do now. Any help will be welcomed. Thanks! application.properties pom.xml DatabaseConfiguration.java Repository from 1st DB Repository from 2nd DB Answer I could

Why is Spring telling me the controller is an unknown entity upon saving a user?

After a few hours of running against the wall with this code, I’ve just about had it. This error is as indescriptive as can be. My User entity: https://pastebin.com/fqRJmMCc TicketController controller with just the function that holds user info: https://pastebin.com/n7jeciAM User service and repository essentials: https://pastebin.com/acYUF7sN Long story short is that the User object should only need a mail address,

Spring HandlerInterceptor fire and forget

I am wondering what would be the best way to make an HTTP fire and forget web service call inside a HandlerInterceptor (or maybe there is something more suitable). Let’s say I am handling requests and I want to notify some API for each response resulting with HTTP 5XX (by sending the request and response body of the request). Of

I can’t put a HashMap object in the MyBatis parameter

I’m trying use a HashMap object to look up ids and passwords in database, but I can’t. I can only get error message as follows: I set my MyBatis mapper as follows: And, I think it’s ok with my controller and dao, but I’ll attach it. I checked the HashMap variable in the controller and dao correctly print their items.

Spring Boot jsp file not found Error 404 weird prefix

I am currently learning Spring/Spring Boot and I am trying to code a forgot password function. All my other functions, like login etc. are working as intended, but redirecting to an reset-password page does not work for some reason and gives me the following error, in which it looks for the jsp with a weird prefix. There was an unexpected

Running a Java configured Spring MVC Application fails to load ApplicationContext, raises java.lang.reflect.InaccessibleObjectException

Environment Eclipse IDE for Enterprise Web applications Tomcat 9 Server Code I started learning spring, following a Udemy course (by Chad Darby). In it, a spring mvc app is configured in java. Relevant files are given below: DemoAppConfig.java MySpringMvcDispatcherServletInitializer.java pom.xml Error While running the web app on tomcat 9 server from eclipse, the following exception is raised: Why is it

Advertisement