Questions tagged [request-mapping]

Issues regarding usage of Spring MVC @RequestMapping methods

348 questions
0
votes
1 answer

Spring Request Mapping call one Function to check User

I have different mappings that start with \mobile or contain \mobile. Is there a way to catch all these mappings? My Mappings are: \mobile\login.mvc \mobile\profile\details.mvc \secure\mobile\profile\edit.mvc Now I want that for all "\mobile"…
Roy
  • 11
  • 2
0
votes
3 answers

Receiving a Bad Request Error (400) after $.ajax POST on Spring Controller

Hello StackOverFlow(s) I'm running with this issue since more than 2 hours now It's simple I'm trying to send a JSON object to a Spring Controller by using a $.ajax POST call I'm using AngularJS but that point is okey here's the code of both server…
Abderrazak BOUADMA
  • 1,526
  • 2
  • 16
  • 38
0
votes
1 answer

Request Mapping in Spring MVC - back to previous URL

I have a problem with redirect in Spring MVC. I have a controller with few methods: //PRINT ALL WORKERS @RequestMapping("/print") public String listWorkers(Model model) { model.addAttribute("workerList", workerService.getAllWorkers()); …
caro
  • 381
  • 3
  • 5
  • 20
0
votes
1 answer

Request mapping in Spring MVC

I have a little problem with my app in Spring MVC. I want to edit users data in my app. So I have edit controller which has listWorkers, redirectWorker and editWorker method. @RequestMapping("/print") public String listWorkers(Model model) { …
caro
  • 381
  • 3
  • 5
  • 20
-1
votes
1 answer

"timestamp":"2023-01-22T11:03:24.467+00:00","status":404,"error":"Not Found","path":"/api/api/acco/treansfer/1/2/20000"

my controller class is package com.SystemFinal.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import…
-1
votes
1 answer

Use @PostMapping in place of @GetMapping

What if I use @PostMapping for fetch request instead of @GetMapping? What is the additional thing I need to add to make this API work Like in my case @PostMapping("/get/{userId}") public ResponseEntity getUSerById(@PathVariable Integer…
-1
votes
2 answers

Get multiple RequestParam of one variable

I'm trying to build a multifunctional search method using MongoTemplate, Query and Criteria. Here is my RequestMapping for variable search: public PagegetUsers( @RequestParam(value = "name", required = false) String name) { …
M G
  • 35
  • 7
-1
votes
2 answers

localhost connection refused in springboot

I am new to springboot. I have a controller class like below, package com.example.controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController public…
-1
votes
1 answer

spring requestmapping testing code doesn't works

i am studying spring 5 and i can not use @RequestMapping annotation and don't know why @RequestMapping includes @Component annotation so I just thought I can use that initRequest includes URL parameter by string i just expected initRequest(/hello)…
-1
votes
1 answer

spring application - get RequestMapping

file : CourseApiApp.java package io.javabrains.springbootstarter; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class…
Ada_lovelace
  • 637
  • 2
  • 6
  • 18
-1
votes
1 answer

In Spring Boot RequestMapping methods, what do "value=" and "return new ModelAndView" do?

In the following code, snapshot of @RequestMapping method `// Get addLocation.jsp. @RequestMapping(value="/add-location", method=RequestMethod.GET) public ModelAndView addLocationJSP() { System.out.println("Location:…
Rachel
  • 3
  • 1
-1
votes
1 answer

How can I use { within value(or path) with @RequestMapping

An example URL is this: api/v1/query?query=up{device="Device_1"} where Device_1 is a @PathVariable I test it with: @RequestMapping(value="/api/v1/query?query=up{device=\"${device}\"}", method = RequestMethod.GET) String…
Aba
  • 1
-1
votes
1 answer

Spring MVC @RequestMapping produces

I'm trying to understand what's going on behind the scenes when using the produces param of @RequestMapping (e.g. produces = MediaType.APPLICATION_JSON_VALUE ) I read somewhere that it calls MappingJackson2HttpMessageConverter? But I can't see the…
GarfieldKlon
  • 11,170
  • 7
  • 31
  • 33
-1
votes
1 answer

Would someone answer some questions about Spring and Request Mapping?

I just started studying Spring, and I'm so confused. I just created a new 'Spring Legacy Project' at STS. HomeController and home.jsp are there. When I run it on server, it comes through the HomeController first, and arrives to…
Jay Bumjun Kim
  • 113
  • 1
  • 1
  • 8
-1
votes
1 answer

spring mvc request method 404 error

@Controller("/UserAction") @RequestMapping("/greet.json") public class UserAction extends BaseAction { @RequestMapping(value = "/hello", method = RequestMethod.GET) public void hello(HttpServletRequest request,HttpServletResponse response) { …
xudong
  • 25
  • 1
  • 7
1 2 3
23
24