Skip to main content

All Questions

3938 votes
31 answers
4.8m views

I use Ubuntu and installed cURL on it. I want to test my Spring REST application with cURL. I wrote my POST code at the Java side. However, I want to test it with cURL. I am trying to post a JSON data....
kamaci's user avatar
  • 75.9k
2644 votes
30 answers
1.2m views

Can @Component, @Repository, and @Service annotations be used interchangeably in Spring or do they provide any particular functionality besides acting as a notation device? In other words, if I have a ...
Colin McCree's user avatar
  • 26.5k
562 votes
8 answers
474k views

I want to make my RESTful API very predictable. What is the best practice for deciding when to make a segmentation of data using the URI rather than by using query parameters? It makes sense to me ...
cosbor11's user avatar
  • 16.4k
561 votes
30 answers
472k views

When trying to convert a JPA object that has a bi-directional association into JSON, I keep getting org.codehaus.jackson.map.JsonMappingException: Infinite recursion (StackOverflowError) All I found ...
Ta Sas's user avatar
  • 9,813
495 votes
34 answers
839k views

This is the exception: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: mvc3.model.Topic.comments, no session or session was closed Here is the model: @...
Eugene's user avatar
  • 5,563
465 votes
25 answers
1.1m views

I am using Spring MVC and this is my method: /** * Upload single file using Spring Controller. */ @RequestMapping(value = "/uploadFile", method = RequestMethod.POST) public @ResponseBody ...
Harikrishnan K.N.'s user avatar
463 votes
13 answers
565k views

I'm using Spring MVC for a simple JSON API, with a @ResponseBody based approach like the following. (I already have a service layer producing JSON directly.) @RequestMapping(value = "/matches/{...
Jonik's user avatar
  • 82.1k
440 votes
15 answers
265k views

Difference between spring @Controller and @RestController annotation. Can @Controller annotation be used for both Web MVC and REST applications? If yes, how can we differentiate if it is Web MVC or ...
Srikanth's user avatar
  • 4,499
438 votes
14 answers
459k views

What is the purpose and usage of @ModelAttribute in Spring MVC?
Mohammad Adnan's user avatar
420 votes
9 answers
563k views

What is the difference between @RequestParam and @PathVariable while handling special characters? + was accepted by @RequestParam as space. In the case of @PathVariable, + was accepted as +.
user1857181's user avatar
  • 4,211
396 votes
18 answers
178k views

This is continuation of question Spring MVC @PathVariable getting truncated Spring forum states that it has fixed(3.2 version) as part of ContentNegotiationManager. see the below link. https://github....
Kanagavelu Sugumar's user avatar
389 votes
11 answers
869k views

We are working on a Spring Boot web application, and the database we are using is MySQL; the setup we have is we first test it locally (means we need to install MySQL on our PC); then we push to ...
Eazy's user avatar
  • 4,039
359 votes
11 answers
622k views

How can I configure and use two data sources? For example, here is what I have for the first data source: application.properties #first db spring.datasource.url = [url] spring.datasource.username = [...
juventus's user avatar
  • 3,582
336 votes
6 answers
190k views

There are concepts and implementations in Spring Security, such as the GrantedAuthority interface to get an authority to authorize/control an access. I would like that to permissible operations, ...
Chinmay's user avatar
  • 4,912
325 votes
4 answers
220k views

I read in some posts about Spring MVC and Portlets that field injection is not recommended. As I understand it, field injection is when you inject a Bean with @Autowired like this: @Component public ...
T. Jung's user avatar
  • 3,697

15 30 50 per page
1
2 3 4 5
3926