html - 如何在 Spring MVC 中使用 Twitter Bootstrap

标签 html css twitter-bootstrap spring-mvc

我不明白为什么我的 Spring MVC 页面不显示 Bootstrap 样式。

我的你好.jsp

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap 101 Template</title>
    <link href="<c:url value="/bootstrap/css/bootstrap.min.css"/>" rel="stylesheet">
</head>
<body>
<h1>Hello, world!</h1>

<div class="btn-group">
    <button type="button" class="btn btn-default">Left</button>
    <button type="button" class="btn btn-default">Middle</button>
    <button type="button" class="btn btn-default">Right</button>
</div>

<script src="<c:url value="/bootstrap/js/bootstrap.min.js"/>"></script>
</body>
</html>

我的目录元素结构:

enter image description here

关于如何正确添加 Bootstrap 的任何想法?

最佳答案

如果您使用的是 Springs 框架,您可以在 dispatcher-servlet.xml 中添加这些行

<mvc:resources mapping="/bootstrap/**" location="/resources/" />

关于html - 如何在 Spring MVC 中使用 Twitter Bootstrap ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22230748/

相关文章:

twitter-bootstrap - 如何更改图表 js 工具提示的 z-index?

html - 悬停在 CSS 中不改变颜色属性

jquery - img 标签周围的空格会导致不同的布局

jquery - 使用 sprite 的平滑 CSS 动画

html - IE 中图像和内联 block 的最大宽度

javascript - select2 bootstrap 大小问题

css - 在 css 中定位 IE7/IE8 (less)

php - 如何将 HTML 字符 NUMBERS 转换为 PHP 中的纯字符?

javascript - 使用 $ ('#MyModal' ).modal ('show' ) 将数据传递到模态;

css - 无法将 Twitter Bootstrap core 和 responsive 编译成一个文件?