I'm developing a system using SpringMVC, when trying to make a call to the controller using the "s: mvcUrl" statement in the JSP the HTTP 404 error is displayed.
I noticed that spring does not transform the "s: mvcUrl" statement into html.
View:
<!-- TagLibs -->
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="s" %>
<!DOCTYPE html>
<html>
<body>
<nav>
<ul>
<li><a href="${s:mvcUrl('AHC#HandleArticle').arg(0, Programacao de Computadores).build()}">Programacao de Computadores</a></li>
</ul>
</nav>
</body>
</html>
Controller:
package com.filipecanattodev.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import com.filipecanattodev.model.Discipline;
@Controller
public class ArticlesHandlerController {
@RequestMapping("/HandleArticle")
public ModelAndView HandleArticle(Discipline discipline){
ModelAndView view = new ModelAndView("ListOfArticles");
return view;
}
}
Settings:
@EnableWebMvc
@ComponentScan(basePackageClasses = { HomeController.class })
public class AppWebConfiguration {
@Bean
public InternalResourceViewResolver InternalResourceViewResolver() {
InternalResourceViewResolver resolver = new InternalResourceViewResolver();
resolver.setPrefix("/WEB-INF/views/");
resolver.setSuffix(".jsp");
return
}