I was reading regarding the @Matrixvariable annotation in Spring doc Spring Doc I have Understood this simple syntax // GET /pets/42;q=11;r=22 but having problem in understanding the below snippet What is this syntax @MatrixVariable(pathVar=”petId””) I haven’t understood the pathVar attribute of Matrixvariable annotation? This line is ok for me // matrixVars: [“q” : [11,22], “r” : 12, “s” : 23]
Tag: spring-mvc
Is it possible to split request params in Spring controllers?
I have a request like: I would like to split those params to bind a List<String> sort in my controller or List<SortParam> where SortParam is the class with fields like: name (String) and ask (boolean). So the final controller would look like this: or Is there a way to make it? UPDATE: The standard way of passing parameters does not
Can’t register an custom Entity in Spring project
Hello I have custom entity which has fields like name, description, date ant others, I created EventRepository and EventServiceImpl. Also i have a model RegisterEvent. Event entity: EventRepository: EventServiceImpl: RegisterEvent Model But when i Try to register event in my Html : I get the following error: And in the browser shows: I don’t know whats happening in the error
HttpMessageNotWritableException: No converter found for return value of type: class java.util.HashMap in Spring MVC
I am trying to return a json using HashMap like this in a method in the controller When I hit this method in PostMan I get this error This is how I have setuped the Application The error says, it cannot convert the list to httpmessges so do I need to any any converters or something like that? What am
Spring MVC with hibernate validation doesn’t work
I have some problems with hibernate validations with Spring. I did everything as explained in an online tutorial, but it’s not working and I just go to the next page without validation error. Controller: customer-form.jsp So, there are no errors in BindingResult when I have an empty field for lastName. What am i doing wrong? Answer Add hibernate-validator in your
Cannot forward to error page for request … as the response has already been committed. As a result, the response may have the wrong status code
I am using Spring Boot 2.0.0.RELEASE, Thymeleaf, Spring Security, JDK 10, Apache Tomcat 9.0.6 . I have controller at application.properties I have I have configuration class When I access http://localhost:8081/cash/ccy or http://localhost:8081/cash/vy I see the same error … The full console log is https://gist.github.com/donhuvy/ad3f65955292d9874805c99c03f3227f#file-console-log-L450 How to fix it? Answer I am missing Thymeleaf dependency. I must add this line to
spring boot mvc – Content type ‘application/json;charset=UTF-8’ not supported
In this spring boot project I get an error when POSTing (using Postman) a new Item resource In the request body I copied one of the existing Items that I got from a GET request (and changed the id and itemName) I made sure that I have the correct getters and setters in the Item class (as this is a
How to resolve SQLServerException: Invalid object name?
I am creating a spring boot application using MS SQL server. I have a requirement where I need to initialize USERS table in user_database database using data.sql file placed in /src/main/resources/ folder and rest of the tables should be created automatically in springboot_db database with the help of @Table annotation. Below is the code snippet. applicaiton.properties file data.sql AppConfiguration.java (One
Spring save locale and change locale when user logs in
I have a spring application that I want users to be able to change the preferred locale. Currently users can change the locale for the current session but I want to be able to save the users option so that whenever they log in, the saved locale is used if one exists. I have a mysql database which I’m using
Spring boot read and new mail Listener on spring-boot-starter-mail
I want to demonstrate the email application using the spring boot MVC in that web application I follow this tutorial I can easily send the emails using spring boot. Here my question is how can I read the emails using spring boot..? how can I listen for new emails and how to update the inbox on the view..? please suggest