Skip to content
Advertisement

Tag: spring

How to extract JSON from sql query?

My query looks like this: I want to retry the messages that failed, but the message is a json string and the offset is a regular string. I need to extract the json messages and the offset strings and then iterate through each row. How would I do this? RIght now I am doing something like this: //Service buildQueryResult() simply

Container based LDAP authentication with Jboss and Spring boot

I’ve a simple API that returns a string. My objective is to secure my API using LDAP authentication. I’ve my LDAP configured in my JBoss EAP 7.1 under the security-domain. I’ve defined my security constraint in the web.xml and the corresponding security-domain in my jboss-web.xml This is my first shot to integrate LDAP with REST API. Not sure what went

Invalid property ‘projection’ of bean class

Hi I need a little help with my code. I tried solutions online but I couldn’t fix my bug. I working in java and spring with mysql and tymeleaf. My error is short: Invalid property ‘projection’ of bean class [com.bakulic.CinemaTicketShop.model.dto.requests.CreateOrUpdateProjectionDTO]: Bean property ‘projection’ is not readable or has an invalid getter method: Does the return type of the getter match

How can you find out from spring cloud function that the connection you established to the database is closed?

In a spring cloud function usage, you don’t want your database connection to keep existing in the database. Once the spring cloud function finishes its process, is the following way to close the function appropriate? How do we validate if the spring cloud function inherently closes the connection even if we don’t do the implementation above? I saw the log

Problem sending the type date with Angular

When I add the date to Spring from Angular, Spring save the day before instead the date that I insert. When I tried on postman everything works so the problem is when Angular send the data. My code on Spring model is: in my controller: In my component.html: I really can’t figure out why, thanks a lot who gonna reply

How to setServletPath() in Spring Junit WebTestClient?

This creates a MockHttpServletRequest that is send to the @RestContoller servlets. Problem: my servlets make use of HttpServletRequest.getServletPath(), but which is always empty using the WebTestClient approach above. Question: how can I explicit set the servletPath in my junit tests? Answer I could solve it as follows, but as this is really hacky, I’d still appreciate a proper solution.

How to implement configuration to use oracle/postgreSQL dataSource with spring+mybatis framework?

Background: spring + mybatis + oracle data source Requirement: support postgreSQL data source exchange with minimum code change Example: Current: controllerA -> ServiceA -> daoA -> A.xml (oracle) Now need: we can configure use oracele/postgreSQL database source If configure use postgreSQL: controllerA -> ServiceA -> daoA -> A.xml (postgreSQL) More: Same controllerA、ServiceA for same business logic Differenct DaoA、A.xml for oracle

format a json of a class in spring

I am new with spring and I want the json response of my class public class Mapping { public String name; public Object value; } be changed from {“name” : ‘value of field name’, “value”: ‘value of field value’} to {‘value of field name’ : ‘value of field value’} I tried @JsonValue and @JsonKey but they didn`t work. how can

Advertisement