Questions tagged [spring-web]

The Spring Web model-view-controller (MVC) framework.

The Spring Web model-view-controller (MVC) framework is designed around a DispatcherServlet that dispatches requests to handlers, with configurable handler mappings, view resolution, locale, time zone and theme resolution as well as support for uploading files. The default handler is based on the @Controller and @RequestMapping annotations, offering a wide range of flexible handling methods. With the introduction of Spring 3.0, the @Controller mechanism also allows you to create RESTful Web sites and applications, through the @PathVariable annotation and other features.

Official Documentation

386 questions
0
votes
2 answers

Filtering findAll using Spring web and data

While designing a new application using spring boot. I wanted to have rest end point for finding all entities with a filter like below GET http://foo.com/entities?firstName=test&lastName=test2 The implementation looks like…
0
votes
1 answer

Why HttpServletRequest truncates url input on a # character?

The following servlet reads the url path parameter. Problem: if the input contains special chars, eg I discovered #, then the string is truncated! @RestController public class MyServlet { @GetMapping("/hash") @ApiIgnore public String…
membersound
  • 81,582
  • 193
  • 585
  • 1,120
0
votes
1 answer

Why can't my Eclipse/Maven/Spring project see the annotation @RequestMapping?

I have a simple maven project in Eclipse for a web app. I added the following dependencies to the pom.xml file ... org.springframework spring-context
user550738
0
votes
0 answers

Spring MVC application deploying multiple times in tomcat

I have application with spring mvc annotation configuration. In my local environment(IDE) it is working perfectly. When i deployed in prod(tomcat 8.5) my application listener calling multiple times. Because of this my executor tasks, schedulers…
user_27
  • 201
  • 7
  • 19
0
votes
2 answers

postHandle method is not invoking after http request handling

I've created following component to add X-Frame-Options into each response: @Component public class SecurityInterceptor extends HandlerInterceptorAdapter { @PostConstruct public void init(){ System.out.println("init"); } …
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
0
votes
0 answers

How to get both the @RequestBody and a @RequestParam in a @RestController?

I want to define a large json response body as @RequestBody parameter. Additionally I'd like to directly get some of the body parameters as @RestController public class MyController { @PostMapping("/") public Rsp test(@RequestBody JsonDTO…
membersound
  • 81,582
  • 193
  • 585
  • 1,120
0
votes
0 answers

Setter method ignored by Jackson

I have the following Java beans: public class Customer implements Serializable { private Integer id; private String name; private Country country; public void setId(Integer id) { this.id=id; } public void…
Pablo Lozano
  • 10,122
  • 2
  • 38
  • 59
0
votes
1 answer

Spring-boot authentication

I have few Spring-boot controller classes to expose few rest web-services. Whenever some user tries to access any of those services, I need to invoke an web-service to check whether the user (user id will be passed as RequestHeader) is authorized or…
bpa.mdl
  • 396
  • 1
  • 5
  • 19
0
votes
1 answer

Hybris Backoffice update with ant updatesystem

I want to update backoffice with ant updatesystem, I'm doing it this way: ant updatesystem -DconfigFile=configWithBackofficeExt.json For example - I have "Administration" and "MyWidget" widgets, I want to remove "Product Cockpit", so I remove…
Evgenii
  • 447
  • 1
  • 10
  • 26
0
votes
1 answer

Spring boot testing REST controller with JPA

I am having issues trying to test THe following REST method @GetMapping @RequestMapping("/create") ResponseEntity createOrders(@RequestBody String body) { ObjectMapper mapper = new ObjectMapper(); try{ …
Sagarmichael
  • 1,624
  • 7
  • 24
  • 53
0
votes
0 answers

Booting Sequence for a multi-module Spring Boot gradle Project

I have a mutli-module gradle spring boot project that I would like to define the order in which the modules are run as one depends on the other for it's environment variables. These would be run in the cloud so, I need a way to make them run…
Sammy65
  • 627
  • 2
  • 12
  • 28
0
votes
0 answers

Spring Maven Web App - Provided Scope

I'm looking for a way to deploy a maven web application using Spring Framework 4.3.13. Everything is working fine when the jars are included (compile scope). I would like to exclude the jar files using (provided scope). I have Wildfly 9 as my…
pcguy
  • 13
  • 3
0
votes
1 answer

Add listener spring web after Applicationcontext is loaded

I'm not sure if it's working, we have a project that loads a file .txt, that is users created on previous deployments. The problem was that the Applicationcontext wasn't loaded, and throws NullPointerException, since the method that loads the file…
0
votes
0 answers

Issue when testing Spring framework

I need to add unit testing to my Spring project. I'm currently using spring framework within JAX-RS, but I'm unable to test it. My pom.xml is as follows:
FVod
  • 2,245
  • 5
  • 25
  • 52
0
votes
2 answers

How to structure spring controllers with functionality shared between web pages

What's a good way to structure spring web controllers when there are different web pages that share functionality? Let's say there are a Tasks and a Task web page. I can start a task from both pages and I expect that I will remain on the same page…
Johan Sjöberg
  • 47,929
  • 21
  • 130
  • 148