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

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

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

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

35
Votes
Published 07 Sep, 2022
Java - @Autowired and @Service working from controller but not from a different package

I need help understanding the concept behind @Autowired and @Service. I have a DAO defined with @Service and controller with @Autowired and everything seems fine, however, I use the same @Autowired in...

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

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

73
Votes
Published 07 Sep, 2022
Java - HTTP Status 405 - Request method 'PUT' not supported

I have the following controller: @RestController public class RestaurantController { @Autowired RestaurantService restaurantService; @RequestMapping(value = "/restaurant/", method = Reque...

70
Votes
Published 07 Sep, 2022
Java - How to prevent Spring MVC from interpreting commas when converting to a Collection in Spring Boot?

We basically have the same problem as this question poses, but for lists and additionally, we are looking for a global solution. Currently we have a REST call that is defined like this: @RequestMapp...

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

116
Votes
Published 14 Sep, 2022
Java - Serializing enums with Jackson

I have an Enum desrcibed below: public enum OrderType { UNKNOWN(0, "Undefined"), TYPEA(1, "Type A"), TYPEB(2, "Type B"), TYPEC(3, "Type C"); private Integer id; private String name;...

22
Votes
Published 10 Sep, 2022
Java - Spring boot after https: The Tomcat connector configured to listen on port 8444 failed to start.

I followed a guide to enable https in Spring Boot. The application was beforehand working on https://localhost:8080 I've created a keystore.jks which is in the same directory as my application.proper...