如何处理spring requestmapping映射后资源文件路径不正确

2025-05-10 23:13:09
推荐回答(1个)
回答(1):

靠spring内部的相应处理类了,先在xml配置好。
映射处理器有BeanNameUrlHandlerMapping和SimpleUrlhandlerMapping



开启自动扫描action路径。

再以下两个class激活@requestMapping接口。
class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/>


@Controller 控制器 组合使用