Issues regarding usage of Spring MVC @RequestMapping methods
Questions tagged [request-mapping]
348 questions
0
votes
1 answer
Filtering a resource in Jersey similar to @RequestMapping "Params" attribute of Spring
I'm in the process of converting all my Spring Services to Jersey, when I came across an issue about how to convert the RequestParam's params feature of Spring to Jersey?
@RequestMapping(value = "/earnings", params =…

Kishore Bandi
- 5,537
- 2
- 31
- 52
0
votes
1 answer
Controller @RequestMapping error URLs
My application doesn't work with requestmapping, the request always works with the same method handleRequest, the controller is RestController.java and the URLs redirects to it when has the path /REST2/*, it works well but always with the same…

Ricard
- 13
- 1
- 6
0
votes
1 answer
My @Autowired service always null when I give no value for @RequestMapping
I have a JSP page that called a method from a controller in my Hibernate project
Here's some of my code in JSP page:
...
...
…

Angelina
- 53
- 1
- 6
0
votes
1 answer
Optional not present while it's being sent
I have a controller method like so
@RequestMapping(value = "/update", method = RequestMethod.POST)
RestResponse updateId(@RequestParam(value = "cityId") Optional cityId) {
}
Now when I send cityId without a value, cityId.isPresent()…

prettyvoid
- 3,446
- 6
- 36
- 60
0
votes
0 answers
How to serve files outside of Spring MVC jar file
We have an annotation-based Spring MVC app with embedded Jetty.
I want to have a "downloads" directory next to our application jar file, and have requests for "/downloads/*" send files from that directory.
I thought it would be simple, but can't…

splintor
- 9,924
- 6
- 74
- 89
0
votes
0 answers
How to use @RequestMapping in Java
I'm quite new to Java and I'm working on a project that has a web-based UI and it then makes various calls to Java code. The calls to the code seem to be done via URL's and Spring @RequestMapping similar to this:
public class myClass()
{
…

irldev
- 409
- 2
- 8
- 21
0
votes
0 answers
Spring MVC RequestMapping couldn't be resolved
I want to revise my codes to make it leaner. My intentions are as below:
I wrote a RedirectServlet to handle all the redirection, so I use the url-pattern /pages/* to make it distinguish from original dispatcherServlet's request mapping.
I also…

Gnostikoi
- 117
- 2
- 3
- 12
0
votes
1 answer
Return "viewName" + variable in Spring MVC
I have a methd in a @Controller, that return the name of the View:
@RequestMapping("/viewNameFiest")
public String methodName(){
return "viewNameSecond";
}
How can I add a variable to the "return" line? A variable like this return…

MDP
- 4,177
- 21
- 63
- 119
0
votes
2 answers
How to handle URL and @RequestMapping in Spring MVC
I have a doubt about the best way to handle the @RequestMapping.
For example:
with this url http://localhost:8080/SpringExample/admin/personaListForm/1 I reach a form, controlled by this…

MDP
- 4,177
- 21
- 63
- 119
0
votes
0 answers
spring requestMapping multiple @PathVariable value handling
I need to find an approach for below problem.
Need to configure below URLs in spring…

pankaj
- 1,643
- 4
- 22
- 35
0
votes
1 answer
Rest Webservice to pass and accept the List
I am new to rest webservice. Could some one please help me to identify the correct approach.
I want My webservice to be consumed Json object ( List id) and produces the Json object.
I want to pass given json data to my service.
{
id : "1"
…

Java_Alert
- 1,159
- 6
- 24
- 50
0
votes
1 answer
Spring servlet URL mapping
I need to add Restful URL in existing spring based web service.
Each URL is well mapped but after clicking Restful URL such as
http://localhost:9090/Mercury/rest/invoice,
all contextroot path is changed as http://localhost:9090/Mercury/rest
The…

JoonHo Kim
- 31
- 4
0
votes
1 answer
spring RequestMapping not working without ModelAttribute
I have controller class with following request mapping method.
appStart() method is responsible for redirecting user to login.html and
logout() is responsible for invalidating session and redirecting user
back to login.jsp
if I remove …

Govinda Sakhare
- 5,009
- 6
- 33
- 74
0
votes
1 answer
How to login with @RestController and send the object to angularjs
I have some trouble figuring out how to create a login form in angularjs using springboot.
I can register a user and send the data to the database but the problems begin when i want to login.
in angularjs i have a function like this
function…

Greg
- 1,690
- 4
- 26
- 52
0
votes
1 answer
Spring @RequestMapping("/favicon.ico") does not work when requested from index.html
I used to get mapping not found for favicon.ico so decided to deal with it.
Easiest thing for me was to add an action to a controller method,@RequestMapping("/favicon.ico").
I no longer get these complaints ( although I don't request favicon.ico…

mjs
- 21,431
- 31
- 118
- 200