映射到控制器方法不起作用。将http://localhost:8080/teleseminars/telesem_live
返回 404,这会显示在日志中:
2012-10-30 11:37:58,190 [http-8086-1] [WARN] [org.springframework.web.servlet.DispatcherServlet.noHandlerFound(DispatcherServlet.java:947)] 找不到带有 URI 的 HTTP 请求的映射 [/ Teleseminars/telesem_live] 在 DispatcherServlet 中,名称为“dispatcher”
任何帮助表示赞赏。谢谢!
这是控制器:
@Controller
public class TeleseminarsController {
private final Logger logger = LoggerFactory.getLogger(getClass());
@RequestMapping(value= "/teleseminars/{page}/{series}", method = RequestMethod.GET) ///{page}/{series}
public String getTele(@PathVariable("page") String page,
@PathVariable("series") String series,
HttpServletRequest request,
final Model model) {
//do stuff
return page;
}
}
我在 web.xml 上有这个
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.do</url-pattern>
<url-pattern>/teleseminars/*</url-pattern>
</servlet-mapping>