问题遇到的现象和发生背景
//控制器
@Controller
public class RustFullController {
@RequestMapping("/commit/{a}/{b}")
public String test(@PathVariable int a, @PathVariable int b,Model model){
int res=a+b;
model.addAttribute("msg","结果:"+res);、
//返回视图
return "test";
}
}
<!--resources文件-->
<context:component-scan base-package="com.controller"/>
<mvc:default-servlet-handler/>
<mvc:annotation-driven/>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"
id="internalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>
最后页面显示404,不是预计的“结果:5”