配置如下
spring-servlet.xml
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
Web.xml
spring
*.do
我在JSP页面的路径是WebContent/views/EnterpriseInfoManag/pollutionBasInfo.jsp
controller的代码是:
@Controller
public class PollutionBasInfoController {
@Resource
private PollutionBasInfoService pollutionBasInfoService;
@RequestMapping("/findPollutionBasInfo.do")
public @ResponseBody List<TBasEnterprise> findPollutionBasInfo(){
List<TBasEnterprise> list = pollutionBasInfoService.findPollutionBasInfo();
return list;
}
我用JS访问controller: url:'findPollutionBasInfo.do'
但是地址就自动变成 http://localhost:8080/SKPWMS/views/EnterpriseInfoManag/findPollutionBasInfo.do
,访问controller的路径自动在前面加上了/views/EnterpriseInfoManag,导致404错误,求指导,为什么会这样,应该怎样解决啊???