Skip to content
Advertisement

Tag: spring-boot

How to add security for spring 5 websockets

I followed the following tutorial: Using WebSocket to build an interactive web application Everything works as described and aplication looks fine. I just have a nice controller: And a bit configuration. Now I want to add security for this simple application. I spent time to find an example but I could not find it. Generally I’ve found the tutorial: Preview

Invalid column name exception – JdbcPagingItemReader query with alias

Spring batch step fails when JdbcPagingItemReader query has a join and alias. It works fine when I remove the join and just do a simple query from employee table. Below is the code snippet that fails. Did anyone encounter such an issue ? Any help would be appreciated. spring-batch-core-4.0.1.RELEASE spring-boot-2.0.0.RELEASE Caused by: java.sql.SQLException: Invalid column name at oracle.jdbc.driver.OracleStatement.getColumnIndex(OracleStatement.java:3965) ~[ojdbc6-11.2.0.3.jar:12.1.0.1.0] at

Spring MessageSource fallback to explicit locale

In some spring boot application, i18n is used. Here is the config: There is a requirement to obtain a locale from header Accept-language, falling back to “en” if: the header is missing, the header has wrong value, the config is missing for the locale. Two first points are resolved by provided LocaleResolver (see config). However, I don’t know how to

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 Rabbit MQ listener issues

My Configuration Class is below:- The DTO is :- The Snippet for publishing the message is:- And the snippet to listen the message is:- The issue is the logs here are not coming up but if I try with The snippet below then it works:- it does goes to the logs but how to get the TestDto in that case?

Spring boot cannot resolve view page

I am trying to run a simple web application with using Spring Boot but there is a problem with resolving view. When I go to http://localhost:8080/ it shows; Is there any missing property or library? Why it cannot resolve my html page? My application.properties; Answer If you use spring boot with some template engine, for example, thymeleaf. You don’t need

401 instead of 403 with Spring Boot 2

With Spring Boot 1.5.6.RELEASE I was able to send HTTP Status code 401 instead of 403 as described in How let spring security response unauthorized(http 401 code) if requesting uri without authentication, by doing this: using the org.springframework.boot.autoconfigure.security.Http401AuthenticationEntryPoint class. I just upgraded to Spring Boot 2.0.0.RELEASE and found there is not such class any more (at least in that package).

Advertisement