Category "spring"

How to set a variable for Controller from HttpInterceptor? [closed]

I am building a Spring Boot application. I like to set a variable for the Spring Boot application. This variable should be set in an HTTP inte

Is there a better way of writing native SQL query with EntityManager Java Spring Boot application?

My current code look like this. I am not using any ORM framework like Hibernate. I need to use this raw SQL query. public List<String> getEndcodedKeyByLen

Post request with content type application/x-www-form-urlencoded not working in Spring

I'm using OpenAPI generator to generate Spring REST APIs. Here is a fragment: openapi: 3.0.2 info: version: 1.0.0 title: Auth paths: '/auth/v1/token':

Spring jar can't see resources

I have Spring Boot web app which work on IntelliJ. I build jar file from maven. Jar starts but css, js and img "blocked" in Chrome console show error 404, Firef

Copying a Java Dynamic Web Project and renaming it to new one causes the error in Tomcat

In eclipse whenever we copying a java dynamic web project into new one by renaming it and trying to run the new copied project in tomcat server it causes below

How to pass parameters from Modal form to Spring Controller with thymeleaf or Jquery?

Anyone can help me? I made a Modal with a form to update a database. I receive data from Mysql DB but when i click on submit, the modal closes, but new paramete

Unable to save an encrypted password with BCryptPassword in database

I am trying to save an encrypted password in postgreSQL database with BCrypt and I have an error. I saw the other answers on stackoverflow I tried to use those

why nginx error 404 when downloading a file

When I try to download a file on a workbench with 3000+ records, a 404 nginx error crashes. When I try to download a file with fewer entries, everything is ok.

Access GlusterFS file system in spring boot application

I am new to GlusterFS. After watching this video https://youtu.be/IGEtVYh0C2o , I have a big picture of how the GlusterFS servers are working. I understand a cl

change the json object value

{ "onboardingInformation": { "apiInvokerPublicKey": "string", "apiInvokerCertificate": "string", "onboardingSecret": "string" }, "notification

Spring boot autowired service all variable fields are null

Currently I have many spring boot services annotated with @Service. Every service works fine and there are no problems. There is a problem only with LogsService

Does Spring framework @value annotation work with other frameworks?

I am developing a library with a Spring framework and adding as a dependent for different frameworks. Does Spring framework @Value annotation inside library wor

Unable to use default username password and make jsonResourcePassword.json work with Apereo CAS SSO

Here is what I have done so far: https://github.com/jnbdz/tutorial-baeldung-spring-security-cas-sso In here you can see my configs: https://github.com/jnbdz/tut

Upgrade Spring Web MVC 4.1.6.RELEASE to 5.2.21.RELEASE -> NoClassDefFoundError: .../web/servlet/mvc/annotation/AnnotationMethodHandlerAdapter

I am upgrading my Spring project 4.1.6 to 5.2.21. But now when I run my Tomcat 8.5.65 I catch this message error: org.springframework.beans.factory.BeanCrea

Spring proxy: BeanPostProcessor or AOP?

We can create proxy for the target bean in the postProcessAfterInitialization() method of BeanPostProcessor. Or we can use AOP - and proxy will also be created

LinkageError: loading constraint violation when overriding method javax/xml/stream/XMLInputFactory.createXMLEventReader

I'm upgrading an application that's hosted on WebSphere 9 running IBM JDK 8 from Spring 4.0.3 to 5.3.18. While doing so I updated the project's Jackson, Woodsto

How to set activiti task name dynamically?

I need to set task name dynamically for activiti 7, just like below snippt code: <userTask id='theTask' name='${taskNameDynamically}' > ... </u

Web socket CORS issue in SpringBoot

I was working on implementing web sockets in springboot, I followed the example spring has given in there docs. But I am getting cors error while trying to conn

Can a Kotlin Object be used as a Spring bean?

Kotlin allows for the definition of singleton objects. In dependency injection (DI) frameworks like Spring or CDI, the life cycle of beans can be defined as sin

How do I share an object between two or more WebSocket controllers in Spring Boot?

I have two controllers, namely ControllerA and ControllerB. In ControllerA I have an object (a HashMap) which maps principal names for connected users to their