訪問http://localhost:8080/seckill/list出現(xiàn)錯誤,不是視頻中的那個:這里說明這個路徑錯了,對spring mvc不太熟,不知道錯哪兒了。配置如下:<bean?class="org.springframework.web.servlet.view.InternalResourceViewResolver">
????<property?name="viewClass"?value="org.springframework.web.servlet.view.JstlView"/>
????<property?name="prefix"?value="/WEB-INF/jsp/"/>
????<property?name="suffix"?value=".jsp"/>
</bean>Controller:@Controller
@RequestMapping("/seckill")
public?class?SeckillController?{
????private?final?Logger?logger?=?LoggerFactory.getLogger(this.getClass());
????@Autowired
????private?SeckillService?seckillService;
????@RequestMapping(name?=?"/list",?method?=?RequestMethod.GET)
????public?String?list(Model?model)?{
????????List<Seckill>?list?=?seckillService.getSeckillList();
????????model.addAttribute("list",?list);
????????return?"list";
????}
????.....
}
運行訪問list頁面出現(xiàn)404錯誤
jason_0133
2016-11-29 18:15:50