【发布时间】:2017-06-24 14:46:45
【问题描述】:
我禁用了 InternalViewResolver 的角色以访问一些静态页面,html 不是 jsp 页面,我进行了所需的更改,确实我做了,我可以访问我的 html 页面,但是当我看到浏览器的控制台时,它看起来好像没有带上我的本地 css 和 js 文件。
这是我的项目结构。
这是我的首页
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>ECommerce view example</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script
src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="/static/css/style.css"/>
<link rel="stylesheet" type="text/css" href="/static/css/login.css"/>
<script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyBR8P_sULnn-egsyhOb6qLYG2oqFshTiwY"></script>
</head>
mvc-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<annotation-driven></annotation-driven>
<context:annotation-config></context:annotation-config>
<context:component-scan base-package="ma.s2m.net"></context:component-scan>
<resources mapping="/static/**" location="/WEB-INF/static/"></resources>
</beans:beans>
【问题讨论】:
标签: java html angularjs spring-mvc