Questions tagged [request-mapping]

Issues regarding usage of Spring MVC @RequestMapping methods

348 questions
0
votes
1 answer

spring boot requestmapping regex

I have a need to have a single function in a controller map to multiple urls differing by only a few characters. url1: npp/v0/membership url2: npp/hcl/v2/membership Is there a way to only allow these 2 strings? What if I want to allow anything…
Jack Peng
  • 576
  • 5
  • 19
0
votes
1 answer

Why can't I go to other Controller rather than HomeController in Spring framework?

I created a Spring project with STS, using MySql with MyBatis. I'm trying to make a function for Members to Sign up, but it only keep visiting Homecontroller.java instead of MemberController, when I click the submit button. This is the arrangement…
Jay. K
  • 52
  • 2
  • 10
0
votes
1 answer

spring boot using @RequestMapping("/xxx.jsp") return 404

I build an application with pure restful interface, do not have any jsp page. I had a controller with RequestMapping annotation: @RequestMapping("/xxx.jsp") when I request with http://localhost:8080/xxx.jsp,it return 404 and redirect to…
viewking
  • 675
  • 1
  • 6
  • 8
0
votes
1 answer

Request is not mapped to the controller

When I go with the url..http://localhost:8080/springdemo/hello..it is showing 404 not found error..I have put my java file inside src/main/java as usual in Maven project. My controller code is as follows :- package org.abhishek; import…
0
votes
2 answers

Which method gets called for below request mapping?

Among the below two methods, which one gets called first? @RequestMapping(method = RequestMethod.POST, params="continue") public String save(){ } @RequestMapping(method = RequestMethod.POST,…
knix2
  • 327
  • 1
  • 5
  • 19
0
votes
1 answer

what is difference @RequestMapping(value="/abc") and @RequestMapping(value="abc")

I've a question Is there difference @RequestMapping(value="/abc") and @RequestMapping(value="abc") ?? In my spring project, they are running a little difference. Actually not a little. could you tell me the difference?
wazz
  • 11
  • 5
0
votes
1 answer

How to simplify the request mappings of these controllers?

I've a controller class with the following signature: @Controller @RequestMapping("/home/users") public class MaterialsController { ... } and every method in this controller class starts with the same path variable, that is, {username}, for…
nbro
  • 15,395
  • 32
  • 113
  • 196
0
votes
0 answers

How to implement POST-GET-REDIRECT when RequestMapping is placed in top of the class?

I have RequestMapping annotation placed in the class level: @RequestMapping("view") public class MyClas {...} I have my method annotated with renderMapping: @RenderMapping(params = "portletAction=myAction") public String MyAction(RenderRequest…
Noah Martin
  • 1,708
  • 9
  • 35
  • 73
0
votes
1 answer

NodeEntity wont persist

I have the following NodeEntity: @NodeEntity(label = "Book") public class Book{ private Long id; private String content; @Relationship(direction = Relationship.OUTGOING, type="WRITTEN_BY") private User author; } where User…
Urr4
  • 611
  • 9
  • 26
0
votes
2 answers

RequestMapping returns 404 error

Yep, I know - there are tones of such questions. I tryed to scan all of them, but the didn't help me. Here is my code: dispatcher servlet
0
votes
3 answers

getResourceAsStream returns NullpointerException

In Spring, I want to get the image to display on my browser. The image is located in my main project i.e. > myproject - src - target - img.png This means that img.png is in the root so I dont supply any path but it returns a…
fscore
  • 2,567
  • 7
  • 40
  • 74
0
votes
2 answers

Spring mvc: I cant map form action url to controller action

I apologize in advance if this or a similar question has already been asked, but I could not find a suitable answer. I have a simple form like this in EditUser.jsp (mapped to: .../admin/users/edit/{userId}):
dim
  • 992
  • 11
  • 26
0
votes
1 answer

Transfer .xls files through POST request in Java REST Api

I'm new to Spring and I have some troubles in receiving a .xls file from the front-end through a POST request. Bassicaly when I accesss the link "Project/File" I receive error code 400(bad request) but the parameters names are the same both in…
GlympS04
  • 13
  • 1
  • 6
0
votes
3 answers

How to programmatically read the path of a rest service?

suppose I have the following simple rest defined: @RequestMapping("/user/data") @ResponseBody public String getUserDetails(@RequestParam int id) { ... } Is there a way to read the path string problematically by another part of the code (i.e.…
shemerk
  • 257
  • 5
  • 16
0
votes
0 answers

Call specific functions (insert, delete) just from on controller and without mapping classes in dispatcherservlet

in spring every page or class is mapped in dispatcherservlet. But how could i call several function without mapping and just use one controller. all insert, delete functions will be defined in another class. index New…
Suraj Roy
  • 51
  • 2
  • 12