【发布时间】:2009-08-10 15:14:26
【问题描述】:
在我的 applicationContext.xml 中,我把这个
<bean id="something" class="com.to.theController"/>
在com.to.theController
我有这样的方法
@Controller
public theController{
@RequestMapping(value="/api/add", method= RequestMethod.GET)
public String apiAddHandler(Model model){
model.addAttribute("api", new Api());
return "apiForm";
}
}
当码头启动时,我可以看到定义bean [something,...
但是当我转到 http://localhost:8080/api/add 时,我收到 404 错误。我错过了什么?我已经调试了apiAddHandler方法,调用URL时不会调用这个方法
【问题讨论】:
-
404 消息说什么?
标签: java spring spring-mvc