Most voted "spring" questions
Spring Framework is an open source framework for developing applications on the Java platform. At its core is rich support for component-based architectures, and currently has more than a dozen highly integrated modules.
Learn more…787 questions
Sort by count of
-
1
votes1
answer153
viewsManage or customize user session in Spring-managed Javase app
I would like to know how to manage or customize the user session in the Javase application (GUI / Desktop / SWING / thinClient) managed by Springsecurity?! For example, how could I set up Timeout in…
-
1
votes1
answer204
viewsHow to map REST request response
I am consuming a REST API with RestTemplate and it does not follow good practices, such as using HTTP status codes, for example. Response in case of success: { "435": { "Codigo": "435", "Tipo": "",…
-
1
votes0
answers161
viewsAngular error
Request URL:http://127.0.0.1:8080/itcd-intranet-ui Request Method:GET Status Code:404 Not Found Remote Address:127.0.0.1:8080 Referrer Policy:no-referrer-when-downgrade view source…
-
1
votes2
answers2178
viewsPersisting a Spring Boot Relationship
I have the following Entity classes Patients @Entity @Table(name = "pacientes", schema = "sau") public class Pacientes implements Serializable { private static final long serialVersionUID =…
-
1
votes1
answer507
viewschange class label according to text
Guys someone could help me with this js please? I need the label to change according to the text, if it is "victory" is Success and is "defeat" is Danger, follow code below: notes my…
-
1
votes1
answer447
viewsWhen I make a request on my Rest API with Spring boot, it is coming with an extra item
I have debugged and the result is coming out a correct list, but when I request in Postman, comes an extra item. Looks like a counter. Can someone tell me what this is and how to take? This is my…
-
1
votes1
answer100
views -
1
votes1
answer690
views@Autowired does not work with my service
I always run the method that accesses what is in another class with @Autowired it is null, follow the code below: @Component public class TokenAuthenticationService { @Autowired…
-
1
votes0
answers20
viewsNull object in View
The request: @Entity @Table(name="wp_posts") public class Pedido implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue private Long id;…
-
1
votes0
answers46
viewsCros Origin + Spring + Angular 4/5
I’m having a problem with my restful service with spring. Even after enabling CORS, I can’t connect with my angular application. @CrossOrigin public class UsuarioController { @Autowired…
-
1
votes0
answers39
viewsQuartz Spring Test Junit
How to recur a Job that is operating in Cluster in Spring? Spring 4.3 Quartz 2.2.3 Example of Job’s declaration @PersistJobDataAfterExecution @DisallowConcurrentExecution public class…
-
1
votes1
answer592
viewsspring boot modules via Maven do not interact
I’m using Spring Boot to create a Restful web service and a SOAP, each in a module but both in a single project. So I decided to separate my domain layer into a third module since it’s the same for…
-
1
votes1
answer269
views3 new user post questions with spring boot
am having the following questions when saving a user in an api using spring boot. 1)The best way to check if the email already exists is this? 2)in case I am sending the id of the user that has just…
-
1
votes0
answers61
viewsAngular and server
I must have done something wrong. I created this class: package br.com.netsoft.configuracao.auth; import java.io.IOException; import javax.servlet.FilterChain; import javax.servlet.ServletException;…
-
1
votes1
answer346
viewsJoin fetch multiple returning duplicate values JPA Criteria API
In the method in question I want to return the consultation with the joins of employee and company. However, the Company class is related to the Query and the Employee, and is returning duplicate in…
-
1
votes1
answer1794
viewsSpring Framework Error: Unable to locate or load main class
I’m following some lessons from a Spring workshop, but I can’t go on because of the mistake: Unable to locate or load main class. Below is the code containing the main function: package…
-
1
votes2
answers364
viewsControl of Rest application transactions in spring
I was studying a little bit on the note @Transactional (version made by Spring), and I came up with a doubt. According to a published in Devmedia, to "more correct form" to use is to write down in…
-
1
votes1
answer530
viewsPaging springBoot
I’m new to Spring and web development and I’m having problems paging a select, this is the method that makes the search: public static Page getAllPeople(Connection connection, Pageable pageable) {…
-
1
votes0
answers201
viewsNo Qualifying bean of type [br.com.spring.JPA.Service.Postservice] found for dependency
Can someone help me with this mistake? No qualifying bean of type [br.com.spring.JPA.Service.PostService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for…
-
1
votes0
answers35
viewsIs it possible to assign the same URL to more than one controller?
I’m trying to use AJAX $.ajax({ url : urlN, // <<- "/log" type: "post", success : function(json) { console.log(json); document.getElementById('content').innerHTML = json; }…
-
1
votes0
answers718
viewsSpring+JPA, visible Transient field in View and not persistent?
Good evening guys, I have a filter that I do manually with @query() that in it I make a total calculating Join of a sale ie, SUM(valor * quantidade) as total At the end I’ll put the filter for…
-
1
votes0
answers101
viewsWhen trying to access Repository with.sun.faces.context.Ajaxexceptionhandlerimpl handlePartialResponseError
Guys, I’m going through a problem here, and I can’t solve it. I’ve looked in the forums, but I haven’t seen any solutions either. Anyone gives this help? The error happens when I try to save the…
-
1
votes0
answers354
viewsJava Spring Boot - Read file inside the . Jar
I’m doing a class that will read an ETL Pentaho Kettle (transformation), I put the file that the class will read in the Resources/KTR folder. But when I try to run the code as a java application…
-
1
votes0
answers59
viewsLog4j in Tomcat application on AWS Beanstalk
I have a multi tenant application developed in Java WEB (Spring) that uses log4j to log logs. Each tenant saves their log files in a specific folder, corresponding to the tenant of the logged-in…
-
1
votes2
answers947
viewsSpring Boot - Senseless 404 error
I’m starting with Spring boot and created a project by Spring Initializr with Spring Boot 2.0.5 and dependencies Web, PostgreSQL e DevTools, I imported the project in Intellij, until then everything…
-
1
votes2
answers682
viewsError while trying to connect to a Postgresql database with Hibernate and Spring Boot
I’m a beginner in Spring Boot and Hibernate, I did a project on Spring Initializr only with the dependencies Web, DevTools e PostgreSQL, but then I added dependency spring-boot-starter-data-jpa, I…
-
1
votes1
answer277
viewscommit with the @Transactional annotation in Spring
Good afternoon! I am new to Java and Spring and I am in need of help in the code below. I need every iteration of for to be performed the commit, but it is only being performed at the end of the…
-
1
votes0
answers114
viewsError calling Java Fx screens in Spring
I am developing a Spring + Java Fx application, when calling the code from the main class screen, it works normally, but if I call another screen, it does not record the information in the model and…
-
1
votes1
answer75
viewsHow to keep the same object between requests in Spring MVC?
I want to add the items to the same object Request dynamically, but always instantiating a new Request. @GetMapping("/novo") public ModelAndView preSalvar(@ModelAttribute ("pedido") Pedido Pedido){…
-
1
votes1
answer155
viewsVoid function with Spring returning null at Angular 6
I have the following code to just delete a record in the bank and that should return a result with the status 204-OK. I use Spring Rest on the back and a void method with a…
-
1
votes1
answer1575
viewsReceiving object by parameter
I’m using Spring MVC and use some mapping to receive an object for example and access that specific object in controller. For example: @GetMapping("/pessoa/{idPessoa}") public ModelAndView…
-
1
votes0
answers118
viewsGet BLOB image from the database using Spring MVC + Thymeleaf
I have problems trying to present an image on the frontend using Spring MVC and Hibernate to return the image stored in BLOB in the database. Entity: @Lob @Column(length = 100000) private byte[]…
-
1
votes0
answers188
viewsCustom authentication page Spring security
I added the spring security dependency to my POM.XML, after which I created a new custom page for user authentication and configured webSecurityConfig to search my custom page, but when running the…
-
1
votes0
answers114
viewsJackson Fasterxml - @Jsonmanagedreference and @Jsonbackreference
I’m using the notes @JsonManagedReference and @JsonBackReference to map my bidirectional relationship, with this I was able to eliminate the infinite loop bug, but it led to another problem. I have…
-
1
votes0
answers82
viewsIs there any problem in persisting an image in postgres and it is of type bytea?
I have an application that was using spring framework version 4 (application that generated a .War full of settings...), it worked plausibly. However, I decided to upgrade to version 5 (using spring…
-
1
votes0
answers745
viewsDemoiselle Signer error when signing Crlrepositoryexception certificate
I am developing a project using the Demoiselle Signer framework Demoiselle Signer. However I am unable to sign the document with the generated certificate. It always generates the following error:…
-
1
votes0
answers249
viewsExample Configuration in Swagger Secutiry with Spring Boot
I am making a documented API in Swagger, when I enter the url of my api, it appears to make an authentication, because it has a Websecurityconfig class that does this for me, but I wanted to make an…
-
1
votes1
answer514
viewsHow to use Spring Data Binding Object for Snake case attributes while maintaining the Java Naming Conventions standard?
Hello, is there any way to perform Binding date of objects in Spring using Snake case? For example, suppose the following request GET on a job REST: http://localhost:8080/Foobar? foo_bar=example For…
-
1
votes2
answers3560
viewsHow to fix the error: cannot deserialize from Object value (no delegate- or Property-based Creator) using Spring Boot?
I am trying to send a JSON to my Spring method for entry into the database but I get the following message: JSON parse error: Cannot construct instance of br.com.marketHubServer.model.Collaborator…
-
1
votes1
answer312
viewsTake the value of a dynamic span element
I need to get an id value of a dynamic span and I’m not getting it. What I’m doing wrong? Error: There was an Unexpected error (type=Bad Request, status=400). Required Long Parameter 'id' is not…
-
1
votes1
answer104
viewsAjax request responding with status 500
I am using Spring, I test the return in the service and controller methods and are correctly returning what I want, and is entered in the database, but even so gives the error: My request:…
-
1
votes1
answer274
viewsError inserting data with Spring
I am entering data that the user type in the console, I take these values with the class Scanner of Java and play in the Postgres database using Spring Boot. The problem is when I will insert a…
-
1
votes0
answers299
viewsRun Spring Boot project without Datasource and Jdbctemplate
I have a project Java with Spring Boot that has to be mult-tenacy and for that I’m trying to use the Flyway to execute the migrate() by an endpoint passing the data needed to connect to a specific…
-
1
votes2
answers248
viewsNull return for a JPA method
I have a method in my Pository that searches for a specific user’s last minute and a specific date as well, both passed as argument. However, if there is no record on the last date it returns null…
-
1
votes1
answer90
viewsAbout implementation using spring
Hello, I need a help, I have a bank with two tables 1-Institution 2-People, for that I created in the model these 2 classes do not know if it is the right way more I did so. I created the Repository…
-
1
votes0
answers666
viewsHow to test one method that depends on the result of another with Junit?
Greetings, I have a class that does actions in an email. I created some tests for this class and would like to know if this is a valid form of testing or if there is any better way to do it. I test…
-
1
votes1
answer49
viewsDoubt about the Controller in spring mvc
Hello. I am studying the spring mvc and I am a few questions about its functioning. One of them is on the part of the controller. When I fill out a form and request a controller method, are all the…
-
1
votes1
answer57
viewsWhy does spring data persist when I use a set?
I have a method more or less like the following within a service: @Transactional public void atualizarPosicoes(Integer novaPosicao, Long idTarefaAtualizada){…
-
1
votes0
answers1567
viewsFormdata with Axios in Node.js
When I try to make a request using form-data with Node, the Springboot application that receives the request says it doesn’t have "Boundary". And when I put any value in "Boundary", the application…
-
1
votes1
answer77
viewsHow do I "share" a request between threads?
I have a "problem" in the system I’m working on, it’s a Java api. Not long ago, they started deploying filters from the request parameters. For every request, it has a preHandle that filters this…