Questions tagged [request-mapping]

Issues regarding usage of Spring MVC @RequestMapping methods

348 questions
0
votes
1 answer

Spring-MVC: find mapping details by its name

Spring-MVC's @RequestMapping annotation has parameter "name" which can be used for identifying each resource. For some circumstances I need access this information on fly: retrieve mapping details (e.g. path) by given name. Sure I can scan for…
Andremoniy
  • 34,031
  • 20
  • 135
  • 241
0
votes
2 answers

Nested @RequestMapping - how it works in Apache Tiles view?

I am using Spring and Apache Tiles (to manage my views). I have Controller class: @Controller @RequestMapping("/insurancecompany") public class InsuranceCompanyController { @Autowired private InsuranceCompanyService…
mpj
  • 327
  • 1
  • 2
  • 12
0
votes
1 answer

Spring MVC multiple requestmapping , missing requestparam

I need to handle two @RequestMapping values by one method.For example /create and create/{id} @RequestMapping(value = {"create","create/{id}"}, method = RequestMethod.GET) public String create_form(@PathVariable(value = "id") Long id,Model model,…
Resul Rzaeeff
  • 448
  • 4
  • 14
  • 30
0
votes
3 answers

wrong URI passed through spring form action

my project is called CV; in a jsp I have the following spring:form action in the "anagrafica.jsp": in the controller I…
Fausto
  • 183
  • 12
0
votes
1 answer

How do you resolve static pages in multiple controllers with different @RequestMapping

I have 2 different controllers annotated with @RequestMapper, one specifying "/" and the other specifying "/rmo". The controller with "/" properly resolves static resources such as .css and .js files. The resources used by the controller with…
AixNPanes
  • 1,170
  • 3
  • 14
  • 33
0
votes
1 answer

Spring Boot not loading static resources it depends on RequestMapping depth

I have problem to load the file under static folder on spring boot application. The problem is RequestMapping depth more than 2 like @RequestMapping("spring/xyz") The @RequestMapping("spring") single depth works well but 2 depth is prefixed 'spring'…
DANIEL K
  • 81
  • 1
  • 1
  • 3
0
votes
2 answers

SpringMVC RequestMapping: Adding .xml to controller path for xml response

/pets yields a json response. I'd like to use /pets.xml in order to yield an xml response, while maintaining @RequestMapping("pets") on the controller. I can use @RequestMapping("/index") @RequestMapping("/index.xml") as a workaround, but that's…
Irikos
  • 305
  • 5
  • 13
0
votes
1 answer

Separating request mappings for Web and REST requests in Spring MVC

I have a Spring MVC web application. Now I want to expose my service as a web service using Spring REST. To do this I want to handle Web and REST requests based on URL values. Below I have tried the same with three controllers, MasterController,…
Rama Arjun
  • 273
  • 2
  • 3
  • 15
0
votes
2 answers

HttpServletRequest in spring getting parameters values as null for post request

@ResponseBody @RequestMapping(value = {"apiRequest"}, method = {RequestMethod.POST}) public String contestApiSignUp(HttpServletRequest req) throws JSONException { try { String username = req.getParameter("username"); String firstname =…
smondal345
  • 65
  • 1
  • 10
0
votes
2 answers

Request Mapping with Multiple Wildcards

I want to have two endpoints that have wild cards in the @RequestMapping @RequestMapping(value="/**", method = { RequestMethod.GET}, produces = "application/json") @RequestMapping(value="/**/versions/{versionId}", method = { RequestMethod.GET},…
Barnesy
  • 253
  • 3
  • 15
0
votes
0 answers

Is there any Annotations in Java Servlet?

Folks, I am working with the Java Servlet based web application and I used the Request URI to handle the multiple client requests into one servlet and used the conditional statement to apply the logics ControlServlet.java public class ControlServlet…
Prajwal Bhat
  • 303
  • 2
  • 5
  • 21
0
votes
1 answer

Class level request mapping @requestmapping execute some code on every request to that class

@Controller @RequestMapping(value = {"user"}) public class UserController { ... @RequestMapping(value = {"dashboard"}) public String index(HttpServletRequest req, ModelMap map) { this.objSession = req.getSession(false); try { …
Subhajit
  • 876
  • 3
  • 17
  • 37
0
votes
3 answers

How to ignore level @RequestMapping() and direct call method level @RequestMapping()?

How to do I ignore the class level @RequestMapping("/home") and directly call the method level @RequestMapping("/users") in Spring? @Controller @RequestMapping("/home") @RequestMapping("/method1") public void…
user2340345
  • 793
  • 4
  • 16
  • 38
0
votes
0 answers

Problems with request mapping

I have problems with request mapping in Spring web app. Here is my controller: @RestController @RequestMapping("/user") public class UserController { @RequestMapping("/is-logged") public Boolean isLogged() { return…
degr
  • 1,559
  • 1
  • 19
  • 37
0
votes
0 answers

How to pass slash or some special characters in request mapping?

I want to pass slash and some special characters (which are coming as a result of encryption) in the request mapping and in path variables. Please help me to resolve this issue. For example: /{empid}/{name}/ where empid is encrypted and has values…