私はSpring 3.0.5を使用しています。私の注釈付きコントローラは認識されていません。私のアプリケーション用のXMLを持っています...作業へのマッピングに問題があります
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<mvc:resources mapping="/static/**" location="/static/"/>
<mvc:annotation-driven/>
<context:component-scan base-package="com.myco.systems.leadsmonitor"/>
私の静的資産がうまく拾われています。私が試してみて、注釈付きのコントローラに到達したときしかし、私は... 404を取得しています
package com.myco.systems.leadsmonitor.web.controller;
@Controller
public class HomeController {
…
@RequestMapping("/")
public void index(Model model) {
model.addAttribute("latestLeadTime", MonitorStatistics.getInstance().getLatestLeadCreationTime());
model.addAttribute("lastDBCheck", MonitorStatistics.getInstance().getLastDBCheck());
}
他に何私は私のコントローラは春によってピックアップを取得するために何が必要ですか?ありがとう、 - Dave
web.xmlのSpring DispatcherServletに使用するURLパターンは何ですか? –