Reputation: 2056
I have an application based in the Spring Web model-view-controller (MVC) framework I have this controller
@Controller
public class ApplicantApplicationsListController extends ApplicantController {
/**
* @throws Exception
*
*/
@RequestMapping(value = { "/medrano/applicant/home",
"/medrano/applicant/home/"}, method = {RequestMethod.GET})
public String viewProductApplications (@ModelAttribute("applicationApplicationsListForm") final ApplicationApplicationsListForm applicationApplicationsListForm,
HttpServletRequest request,
Model model ) throws Exception {
return "applicantApplicationsView";
}
But I got a 404
in the browser when I put
Upvotes: 1
Views: 279
Reputation: 2056
I forgot to Configure the Spring DispatcherServlet in the file web.xml with:
...
<servlet-mapping>
<url-pattern>//medrano/applicant/home</url-pattern>
<url-pattern>//medrano/applicant/home/</url-pattern>
</servlet-mapping>
...
Upvotes: 0
Reputation: 32145
You have a mapping problem with your request mapping:
The annotation @RequestMapping value
property expects an array of String
s, in your case:
value = {"/medrano/applicant/home",
"/medrano/applicant/home/",}
Is not a valid String[]
, you have an additional ,
at the end, just remove it.
You can check the Spring MVC @RequestMapping Annotation Example with Controller, Methods, Headers, Params, @RequestParam, @PathVariable tutorial for further exmaples on how to use it.
Edit:
value
and method
properties."/medrano/applicant/home"
twice in your RequestMapping.It could simply be like this:
@RequestMapping(value = "/medrano/applicant/home",
method = RequestMethod.GET)
Upvotes: 2