为了账号安全,请及时绑定邮箱和手机立即绑定

SSM框架设置好了springMVC的静态页面访问却打不开jsp页面了,忙活大半天无果求解!!!

SSM框架设置好了springMVC的静态页面访问却打不开jsp页面了,忙活大半天无果求解!!!

迷失代码林 2017-07-25 12:58:21
项目没问题的,业务功能都能正常实现,后来为了添加JS文件,就设置静态资源访问,但是一旦设置之后jsp页面就访问不了,配置文件如下:(js文件在webroot目录下,与WEB-INF平级)<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop"  xmlns:mvc="http://www.springframework.org/schema/mvc"  xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd            http://www.springframework.org/schema/context            http://www.springframework.org/schema/context/spring-context-3.0.xsd            http://www.springframework.org/schema/aop             http://www.springframework.org/schema/aop/spring-aop-3.0.xsd            http://www.springframework.org/schema/mvc            http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd            http://www.springframework.org/schema/tx             http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> <!-- 使spring扫描包下的所有类,让标注spring注解的类生效 --> <context:component-scan base-package="/" /> <!-- 对转向页面的路径解析。prefix:前缀, suffix:后缀 --> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/jsp/" /> <property name="suffix" value=".jsp" /> </bean> <!-- 静态资源文件访问,SPRINGMVC中无法直接访问静态资源 -->  <mvc:default-servlet-handler /> <!-- <mvc:resources mapping ="/js/**,/css/**" location="/js/,/css/" />   --> </beans>
查看完整描述

3 回答

?
rookie2maven

TA贡献278条经验 获得超76个赞

Web.xml

查看完整回答
反对 回复 2017-07-26
  • 3 回答
  • 0 关注
  • 7263 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信