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
1 answer

Spring WebMVC 5 - Annotation based Interceptor

How to configure an Interceptor, through Annotation only(I do NOT like to register the interceptor in .XML file, I do not use .XML based configuration)? Note : I see in example on internet it is suggesting to use…
CR Sardar
  • 921
  • 2
  • 17
  • 32
0
votes
1 answer

Spring's URIComponentsBuilder converts colon (:) for port number into slash (/)

In a test, I am injecting an example URL with a colon for a port number ("http://example.com:port") into my configuration, which is then used by my production code to construct a UriComponentsBuilder which ultimately creates a URI String. However,…
DaveyDaveDave
  • 9,821
  • 11
  • 64
  • 77
0
votes
1 answer

Spring: No mapping found for HTTP request with URI [uri] in Dispatcher Servlet

This is a Spring MVC project where the view is redirected through servlet-dispatcher.xml. The dispatcher is unable to map to the given URI. Attached images contain the project structure that may also help to find the mistake. Following is the…
Nikhil
  • 21
  • 4
0
votes
0 answers

Spring data mongodb does not work with spring data jpa in spring webmvc applicaition

I have a legacy spring mvc web application which uses spring data jpa 1.9.5. Same application breaks as soon as I add dependency for spring data mongodb 1.9.5. POM: org.springframework.data
0
votes
1 answer

@Id Not Mapped For Specific Entity In A Spring-Boot Controller

I have two entities Employee and Department and each have a Spring Web @RestController annotated class with update methods i.e. Http PUT. For some strange reason (and likely a blindingly obvious solution) whenever the PUT is called for the Employee…
D-Dᴙum
  • 7,689
  • 8
  • 58
  • 97
0
votes
1 answer

Spring controller cannot read image file from multipart/form-data post request

I am trying to upload a form that has both text fields and an image using multipart/form-data as the content type. When i do the post from my angular application i can clearly see in the console that the content-type is correct and that the request…
Maurice
  • 6,698
  • 9
  • 47
  • 104
0
votes
0 answers

Trigger Spring Security Login on Secured Request?

Spring Security "will provide you with a login form"...https://docs.spring.io/spring-security/site/docs/current/guides/html5/hellomvc-javaconfig.html So how can I trigger the built-in form on the secured requests? @Override public void…
0
votes
1 answer

Spring Web: Mapping URL to a standalone Spring app

I have two standalone Spring Boot/Web web app .jars, A and B, both made by third-parties, with their own URL mappings which I do not know about in advance. I would like to create a setup where "localhost:8080/A" maps (passes through) to A's "/"…
Ray Zhang
  • 1,411
  • 4
  • 18
  • 36
0
votes
1 answer

Spring MVC Matrix Variables retrive only one param value

I'm building a spring-mvc rest API application and I intend to use matrix variables for some of my endpoints. Unfortunately I'm not able to retrive more than one value per matrix variable used. My spring-mvc version is spring-webmvc:4.3.12.RELEASE I…
Josef
  • 43
  • 1
  • 4
0
votes
0 answers

Spring Security and OPTIONS, *NO* CORS

That's NOT "yet another question on CORS support in Spring Security". I am perfectly aware that the exist an elegant solution - more than one, actually - of using a Spring-provided CorsFilter to make preflight requests bypass authentication filter…
Maksim Gumerov
  • 642
  • 8
  • 23
0
votes
0 answers

Spring web dependency for class loading

I have a spring web project which I build using maven-assembly-plugin so that I can produce an uber/fat jar. I am also using spring web as I want to use HttpRequest & HttpResponse org.springframework
Vishal Biyani
  • 4,297
  • 28
  • 55
0
votes
1 answer

How to exclude validation properties only on the mvc layer (and keep for database layer)?

I want to use the same bean for both database persistance, and for a webservice json request. Problem: I have a property that should never be set by the webservice user, but filled by the application before persistance. The field in the db is marked…
membersound
  • 81,582
  • 193
  • 585
  • 1,120
0
votes
1 answer

Run Spring WebFlux @Controller without Spring Boot

I'm trying to start Spring application from main without Spring Boot, I managed to get working router functions, but can't make to work classic @Controllers. I debugged and watched source of boot and built in configs, added…
Simon
  • 997
  • 1
  • 15
  • 29
0
votes
0 answers

Redirect ping command output to textarea from spring controller using jquery ajax call

I want the ping command output to be displayed in the textarea on the webpage. I have my controller method as : @RequestMapping(method = RequestMethod.POST, value = "testInternet.html") @ResponseBody public String testInternetConnection() { …
Sam Brooks
  • 143
  • 9
0
votes
2 answers

Issue with Spring Rest @RequestMapping when negating params

I have two spring controller methods : @RequestMapping(value="/requestotp",method = RequestMethod.POST,params = "!applicationId") //new customer public OTPResponseDTO requestOTP( @RequestBody CustomerDTO customerDTO){ return…
osama yaccoub
  • 1,884
  • 2
  • 17
  • 47