Latest Questions tagged Spring Mvc

Browse all latest questions tagged Spring Mvc

11
Votes
Published 14 Sep, 2022
Java - JSONObject Expected to find an object with property ['XXX'] in path $

I have made a program to consume a third part API: I have a service Called:NewsService @Service public class NewsService { @Autowired private NewsRepository newsRepository; public List&lt...

87
Votes
Published 24 Oct, 2022
Java - POST array in RequestBody to Spring Controller as List of Objects

I'm fairly new to Spring, and I've looked at many posts about similar scenarios, but I have yet to figure this out. I'm trying to alter an existing (working) endpoint in my project to pass an array...

73
Votes
Published 06 Sep, 2022
Java - How to map Page<ObjectEntity> to Page<ObjectDTO> in spring-data-rest

When I hit the database with PagingAndSortingRepository.findAll(Pageable) I get Page&lt;ObjectEntity&gt;. However, I want to expose DTO's to the client and not entities. I can create DTO just by injec...

11
Votes
Published 07 Sep, 2022
Java - how to capture connection event in my webSocket server with Spring 4?

I did a simple web socket communication with spring 4,STOMP and sock.js, following this https://github.com/rstoyanchev/spring-websocket-portfolio and this http://assets.spring.io/wp/WebSocketBlogPost....

17
Votes
Published 11 Aug, 2022
Jquery - Requested unknown parameter '1' from the data source for row 0 ( JTable Issue )

I am using JTables with Spring / Ajax , the data is being returned from Spring and is visible in Firebug. However when the JTable is getting painted , I am getting this error Requested unknown param...

122
Votes
Published 07 Sep, 2022
Java - Error: org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'text/plain;charset=UTF-8' not supported

I'm newbie in Spring Data. I keep getting the error: org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'text/plain;charset=UTF-8' not supported I've tried to change consumes ins...

129
Votes
Published 01 Sep, 2022
Java - How to return JSON data from spring Controller using @ResponseBody

Spring version 4.2.0, Hibernate 4.1.4 Here is my Controller function: @RequestMapping(value = "/mobile/getcomp", method = RequestMethod.GET) @ResponseBody public List&lt;Company&gt; listforCompanies...

12
Votes
Published 06 Sep, 2022
Java - What exactly is Field Injection and how to avoid it?

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...

11
Votes
Published 24 Jun, 2022
Reactjs - Issue with MultipartFile Upload From React/Node

I have the following JAVA controller: @RequestMapping(value = &quot;/data/upload&quot;, method = RequestMethod.POST) public @ResponseBody void uploadData(@RequestParam(&quot;file&quot;...

72
Votes
Published 18 Aug, 2022
Java - Servlet.service() for servlet [dispatcherServlet] in context with path

I am getting below error while creating spring maven rest webservice. It works fine when i use postman to test post request on the api for ocbc. But when i tried to do post request for citi, i got the...

90
Votes
Published 07 Sep, 2022
Java - Spring MVC Request method 'GET' not supported

I have found few questions on this topic however it does not necessary answer my question Basicaly I am passing some values via url so data can be gathered from database. I can do it via method= Requ...

43
Votes
Published 04 Sep, 2022
Java - unit testing for spring mvc controller with Integer value as @RequestParam

I have the following controller which accept input as @RequestParam @RequestMapping(value = "/fetchstatus", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public Response fe...

98
Votes
Published 20 Aug, 2022
Java - @SpringBootTest Error creating bean with name 'requestMappingHandlerAdapter'

I'm having problems with spring boot. I got the error Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2019-09-22 10:16:18.954 ERROR 13...

20
Votes
Published 04 Sep, 2022
Java - Spring validator never called

I am trying to validate some information, so I added a validator and used @Valid in the parameter of the post method: @Controller @RequestMapping("/user.htm") public class UserController { @Auto...

24
Votes
Published 02 Sep, 2022
Java - Spring Custom Annotation Validation with multiple field

A little greedy question here, hope this one could also help others who want to know more about annotation validation I am currently studying Spring, and for now, I am planning to try out the customi...