How to use twitter bootstrap with JSP
I can't understand why my jsp page don't huck up bootstrap styles.
My hello.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>
My directory project structure:
Any ideas how to properly add bootstrap?
如果您正在使用Springs框架,则可以在dispatcher-servlet.xml中添加这些行
<mvc:resources mapping="/bootstrap/**" location="/resources/" />
Try using https://github.com/Mrdigs/Bootstrap.jsp
Its an open source JSP taglib designed to make working with Bootstrap and JSP simple, quick, and rewarding.
It's also like my problem while using this BootStrap thing. in your folder-tree like that you wrote
value="/bootstrap/css/bootstrap.min.css"
try
value="bootstrap/css/bootstrap.min.css"
without using '/'
链接地址: http://www.djcxy.com/p/19274.html上一篇: Rebol尾巴呼叫优化
下一篇: 如何在JSP中使用twitter引导