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
-
2
votes1
answer455
viewsRecover Cookies in Spring Security Authentication
How can I recover cookies when the user logs in through Spring Security and with the implementation of the interface AuthenticationProvider? If I recover an instance of HttpServletRequest from a…
java spring cookies spring-security requestasked 8 years, 11 months ago Giancarlo Abel Giulian 3,999 -
2
votes2
answers1743
viewsJdbctemplate - How to commit and rollback?
i am working with a Desktop application and use spring to realize my Inserts in the database. The object I’m using is Jdbctemplate, which has the datasource encapsulated within it. I would like to…
-
2
votes2
answers822
viewsMake a consultation with Ibernate criteria with Spring
Good evening, friends, I have a question. I have a Class called Proposal and another Customer Call. In the client there is the CPF field and a Proposal has a Client. I need to search for…
-
2
votes1
answer764
viewsHow to create a prefix for the url using spring boot
I learned to use the spring doing all the configuration in java classes and now I’m migrating to the spring boot 2.0.2. I would like to know how to create a prefix in the URL that has the name of…
-
2
votes1
answer117
viewsHow to configure log4j2.xml with different parameters per environment
How to use log4j2 with different parameters per environment in spring boot. I need the log to be generated with a different name for each environment.
-
2
votes3
answers131
viewsMultiple query values with JPA/Sprint and Rest
Good morning, I need to make a query via REST where multiple ID will be sent for example (ID: 1, ID: 2, ID:3, etc). To search only for an ID I use findById(codigo), but I don’t know how to use…
-
2
votes1
answer384
viewsWhat happens internally when running a Spring Boot application?
Recently I have been studying Spring Boot, I wanted to know what happens internally when an application is started, because every project has a main class that is always noted with…
-
2
votes1
answer177
viewsHTTP - Correct return types
I have some questions regarding the most appropriate status for each situation to follow: PUT in Object without Id PUT in the URL localhost:8080/users/1 with a JSON without the attribute Id. PUT in…
-
2
votes4
answers1376
viewsApplication with Tomcat and Spring Boot
Hello! I am having following problem in my application. After running the main method just below and enter in the browser the address of my application localhost:9090/restaurantWeb is opening a…
-
2
votes0
answers159
viewsSpring secutity Oauth2
It generates the token { "access_token": "0b42ea14-6a21-44fc-9f65-df60f9130542", "token_type": "bearer", "refresh_token": "3653d5f8-161a-4ee2-b3b5-df9e1da4b9a7", "expires_in": 498, "scope": "bar…
-
2
votes0
answers106
viewsLearning Problem with Springboot
Hello, I’m starting my study at Springboot, where I got to a part that I couldn’t solve on account of an Exception, where I’ve seen on various topics of how to solve, and none worked for me. I…
-
2
votes1
answer177
viewsI can’t access static content in spring-mvc
How do I access static content from spring-mvc? For example a css. I have the following spring configuration: import java.util.Properties; import javax.sql.DataSource; import…
-
2
votes1
answer195
viewsRestful with Spring, Hibernate, Maven, Postgresql and Wildfly - Createcriteria
I am doing a Restful project with the following frameworks and am going through a problem, I created a User class to relate to the database, then I created the userDao to carry out the CRUD methods…
-
2
votes0
answers207
viewsRelationship between three tables - Postgresql
need to make a relationship between three tables in the database in Java, created the two entities and the methods of the two entities, now need to insert a relationship table that has only two…
-
2
votes4
answers2676
viewsProblem with Beans in spring : No Qualifying bean of type
I’m having the following problem with the Beans in spring: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'agrupamentoTaxonomiaController' defined in…
-
2
votes2
answers894
viewsHow to return a "not found" feature in Spring?
I’m running some tests on Spring to return error 404 in case he doesn’t find one id when searching in Repository, but is giving 200 OK. @RequestMapping(value = "/{id}", method = RequestMethod.GET)…
-
2
votes0
answers257
viewsHow to write the Junit test with Spring Autowire?
I am currently setting up a Dynamic Web project to run unit tests, but this project is using dependency injections by Spring Frameworks, it is important to mention that the version of spring that…
-
2
votes2
answers2249
viewsHow to release CORS to a particular address?
I’m not getting the release CORS for http://localhost:8080, am using Spring Security. I find the following error: Xmlhttprequest cannot load http://localhost:9991/login. Response to preflight…
-
2
votes1
answer374
viewsHow to test java exceptions using spring and Junit 5 lib?
I’m in doubt about how to test my java exceptions using the Spring Framework’s own resources. I’m testing a class called UsuarioValidator.java and in it I have a method called…
-
2
votes0
answers416
viewsValidation with Spring MVC
You guys talk beauty? Well, I started studying Spring by Algaworks courses recently and today I came across a problem, is the following: I have a form that shows me a list of employees, and as it…
-
2
votes1
answer1612
viewsThymeleaf does not find Sources
I’m creating a project with Springboot and Thymeleaf. I set up the whole project, I find the template and the pages, so my template can’t find the files css and js; Html <link rel="stylesheet"…
-
2
votes1
answer275
viewsWhat is the point of using Assert.assertNotNull() in frameworks?
I have seen in the Spring Boot framework that they use a lot of Assert.assertNotNull() to validate the variables if they are receiving null values. It is correct to use this same approach in…
-
2
votes1
answer56
viewsWhy instantiating objects using new keyword is hardcoded?
I am learning Spring, and several times I have come across instructors solving the "problem" of instantiation of objects being made by keyword new, as in: private SpeakerRepository repository = new…
-
2
votes2
answers224
viewsSetup pointcut AOP Spring
I have the below pointcut setting on Spring 3 <aop:config> <aop:pointcut id="baseDaoPointcut" expression="execution(* br.com.infraestrutura.domain.BaseDao+.*(..))" /> <aop:pointcut…
-
2
votes1
answer1094
viewsHow do I login to Spring Security, JSF 2.2, and Managedbean?
Hello. I need some help. I am configuring Spring Security in a JSF Project 2.2. Using Annotation. I’ve been able to configure the filters. But I don’t understand how to configure login Managedbean…
-
2
votes1
answer78
viewsGson Return Array of One Position
Hello I have the method : @RequestMapping("/olaMundo") public String iniciando(Model model, Cadastro cadastro){ CadastroDAO dao = new CadastroDAO(); dao.adiciona(cadastro);…
-
2
votes2
answers145
viewsProblems trying to save data from the form
I am not getting through the HTML page to insert the name and save. Could anyone explain what is happening? @Entity public class Livro { @Id @GeneratedValue(strategy = GenerationType.AUTO) private…
-
2
votes0
answers306
views -
2
votes1
answer525
viewsImplications of @Autowired on and off
When working with Spring I realize two patterns of using the @Autowired, declare inside the manufacturer and outside. Builder @Service public class myService { private final PartnerRepository…
-
2
votes1
answer543
viewsProblems with image localization in the Spring Framework
I’m using Spring and Thymeleaf: I have an image in the directory: Resources/image/Telescope.png When I open the page posts.html (home),located at the address below, the image is displayed.…
-
2
votes1
answer137
viewsProblems with improper access to urls in the application with Spring Security
I have a page, which uses Thymeleaf to update a user’s profile and on this page there are two buttons that allow you to update the profile and the other button allows you to remove the profile of…
-
2
votes1
answer96
viewsResult of the GET method brings all database relations and subrelations
I have an application where I have a listing screen I’m doing a GET method on my Spring Boot API Controller class @RequestMapping(method = RequestMethod.GET, value = "/distritos", produces =…
-
2
votes2
answers116
viewsAPI method searches for information but does not appear in front-end
I have a method of my API that does a database search @RequestMapping(method = RequestMethod.GET, value = "/entidadesUsuarioPermissao/{id}", produces = MediaType.APPLICATION_JSON_VALUE) public…
-
2
votes0
answers839
viewsSpring Boot connectable in Microsoft Sql Server database
I’m trying to connect in Sql Server 2008 database, but this giving this error: com.microsoft.sqlserver.jdbc.Sqlserverexception: Connection to ERSERVER host failed, instance named sqlern_desenv.…
-
2
votes1
answer48
viewsOnetoone returning wrong value
Guys, help me please, I’ve got a problem here and I’ve been racking my brain trying to figure this out for hours. I use Spring in the project and have the following relationship in one of my models:…
-
2
votes2
answers1539
viewsc3p0 error - bad pool size config start 3 min 5. using 5 as start
Hey there, guys! Can anyone help me how to fix this error below? I tried a lot and nothing. Error: 12-Dec-2017 20:27:27.908 INFO [http-nio-8084-exec-6]…
-
2
votes0
answers196
viewsUnable to calculate MD5 hash in upload file using AWS Sdk in java
Guys, I’ve searched several forums and no solution solved my problem. When I upload the file to S3 using the Amazon API. The following exception shall be made. com.amazonaws.SdkClientException:…
-
2
votes1
answer253
viewsWhen should a utility class become an injectable dependency?
I often write small utility classes to solve some minor problem in my code. For example (I will use Spring for DI): @Service class PessoaService { public PessoaResponse converter(Pessoa pessoa, Long…
-
2
votes1
answer552
viewsStore digital certificate on Server
I am creating an application that will work and manage digital certificate of customers. The idea is to import the customer’s certificate and I leave available subscription and transmission methods…
-
2
votes0
answers555
viewsAllow access to S3 files without exposing AWS URL
I need to generate links to download files that are stored in S3, but my company does not want to expose the AWS URL. Our system is developed in Java and Spring, until then the system recovered the…
-
2
votes1
answer115
viewsIs there a way to do "Migration" in Rabbitmq?
Hello! I wonder if there is any alternative to create/change/remove Exchanges, queues and bindings without relying on the framework (in my case, Spring) for this. Often we need to change the name of…
-
2
votes1
answer1361
viewsRepository not found when starting Springboot
I am running my spring boot project with mysql connection and is giving the following failure: Description: Field er in com.eventoapp.controllers.Eventocontroller required a bean of type…
-
2
votes0
answers94
viewsA help with Spring Boot Annotations
A help with Annotations ... Today my tests are like this : @ConfigA @ConfigB @ConfigC @ConfigD public class MeuTesteA {} @ConfigA @ConfigB @ConfigC @ConfigD public class MeuTesteB {} See, I have to…
-
2
votes0
answers70
viewsHow to change the @Generatedvalue used by Spring through Spring’s Abstractpersistable class?
I’d like to use the @GeneratedValue(strategy = GenerationType.SEQUENCE, ... ... when extending the class AbstractPersistable, but I don’t know if that’s possible. From what I saw in the…
-
2
votes1
answer163
viewsHow to configure the Auditor using Spring Boot 2.0.2
Here’s a class I used with spring framework version 4.3.4.RELEASE (I still didn’t use spring boot) and that worked: import org.springframework.data.domain.AuditorAware; import…
-
2
votes1
answer242
viewsObject Serialization Error with Spring Data and Spring Web
I was creating a simple endpoint of an entity and ended up getting the following exception: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class…
-
2
votes1
answer159
viewsJava Spring - Null returns repository
This is my Apikey class: @Entity @Table(name="API_KEYS", schema="DEMO_PIMS") @JsonIgnoreProperties(allowGetters=true) public class ApiKey implements Serializable{ private static final long…
-
2
votes0
answers46
viewsError setting Spring
Could someone help me with this mistake: Invalid Namespacehandler class [org.springframework.data.jpa.Repository.config.Jparepositorynamespacehandler] for namespace…
-
2
votes1
answer48
viewsConversion error when sending input to controller to save
Good evening guys, I’m having trouble solving this problem, I hope you can help me... When trying to save data from View only one field returns this error: Failed to Convert Property value of type…
-
2
votes1
answer345
viewsRelationship between Rest Resources with Spring boot
I’m learning Spring Boot Rest and with a doubt I can’t solve on my own, you could help me? I created the following mapping between Launch and Person entities: Entidade Pessoa: @Entity public class…