Skip to content
Advertisement

Tag: spring

How to return a set of objects with Spring Boot?

I did a lesson about Spring Boot and it works perfectly. But what if I want to return a set of objects ? I tried doing this but it doesn’t work. How can I do it correctly ? With one object (it works): With many objects (it doesn’t work): Answer If you compare your original method to your newly made

Handle Security exceptions in Spring Boot Resource Server

How can I get my custom ResponseEntityExceptionHandler or OAuth2ExceptionRenderer to handle Exceptions raised by Spring security on a pure resource server? We implemented a so whenever there is an error on the resource server we want it to answer with The resource server uses the application.properties setting: to authenticate and authorize a request against our auth server. However any spring

native query join in spring data

I have the class: I want to know if it’s possible to use a native query join in spring data JPA and if the result of query was correctly mapped into entities like the above example. Can someone show me a complete example to user this. I must to use a native query in my case and I am not

Jackson is ignoring spring.jackson.properties in my spring boot application

Jackson is ignoring spring.jackson.property-naming-strategy=SNAKE_CASE. I am using springBootVersion 1.4.2.RELEASE. In my application.properties file, I have added spring.jackson.property-naming-strategy=SNAKE_CASE But Jackson is not honoring this property, and my REST response is still camelCase. Interestingly, this annotation works just fine @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) With this annotation, I am getting snake_case response. But I don’t want to annotate each response class, it’s a bit annoying. Edit

What is the Compatible version of Spring-security with spring-4.3.0-release?

Which version of spring security is compatible with Spring-4.3.0-release. my jars are as follows spring-aop-4.3.0.RELEASE.jar spring-beans-4.3.0.RELEASE.jar spring-context-4.3.0.RELEASE.jar spring-context-support-4.3.0.RELEASE.jar spring-core-4.3.0.RELEASE.jar spring-expression-4.3.0.RELEASE.jar spring-jdbc-4.3.0.RELEASE.jar spring-orm-4.3.0.RELEASE.jar spring-oxm-4.3.0.RELEASE.jar spring-tx-4.3.0.RELEASE.jar spring-web-4.3.0.RELEASE.jar With Security jars spring-security-config-3.2.5.RELEASE.jar spring-security-core-3.2.5.RELEASE.jar spring-security-web-3.2.5.RELEASE.jar Answer The documentation for spring security 4.2.x says that the current spring security version 4.2.x is compatible with 4.3.26 and 4.0.x. For spring security 3.2.5 you should use spring

Optional pagination with Spring

I am pretty new to java and spring. What I want to implement is api endpoint /tickets with pagination and sorting. I made it and it works. But also what I would like to do is to return plain list of all tickets if size and page are not specified in the query params, so in FE I can use

Advertisement