java - Bootstrap 不适用于 jsp

标签 java css jsp

我正在尝试为我的 jsp 页面连接 min lib css bootstrap。 但是什么也没发生! 我的 proposal.jsp 页面:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ page session="false"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/bootstrap.min.css">
<script src="../../js/bootstrap.min.js"></script>
</head>
<body>

<h3>Tests List</h3>
<button type="submit" class="btn btn-info">
    <span class="glyphicon glyphicon-search"></span> Search
</button>
<c:if test="${!empty listTests}">
    <table class="table table-striped">
        <thead>
            <tr>
                <th width="25">Test ID</th>
                <th width="80">Test Name</th>
                <th width="80">Test Author</th>
                <th width="120">Test Description</th>
                <th width="60">Test IsFree</th>
                <th width="120">Test Comment to Admin</th>
                <th width="120">Test Section</th>
                <th width="120">Test Status</th>
                <th width="60">Review</th>
                <th width="60">Delete</th>
            </tr>
        </thead>
        <c:forEach items="${listTests}" var="test">
            <tr>
                <td>${test.id}</td>
                <td>${test.name}</td>
                <td>${test.author}</td>
                <td>${test.description}</td>
                <td>${test.isFree}</td>
                <td>${test.commentToAdmin}</td>
                <td>${test.section}</td>
                <td>${test.status}</td>
                <td><a href="<c:url value='/tests/review/${test.id}' />">Review</a></td>
                <td><a href="<c:url value='/tests/remove/${test.id}' />">Delete</a></td>
            </tr>
        </c:forEach>
    </table>
</c:if>
</body>
</html>

我的文件夹层次结构:

folders

如何查看 - 在代码中我连接了 css 和 js 文件。但是我得到了结果(是的,我用数据库加载的信息): result

最佳答案

尝试使用对文件的绝对引用。

<link rel="stylesheet" href="/css/bootstrap.min.css">
<script src="/js/bootstrap.min.js"></script>

关于java - Bootstrap 不适用于 jsp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44661493/

相关文章:

java - 将用户主体从 REST 传播到 EJB 层

html - 在 IE 中隐藏 CSS 元素

javascript - 制作 jQuery 动画循环

java - JSTL if 标签始终执行为 true

java - 如何在jsp中使用for循环循环复选框?

java - java中的电话键盘无法正常工作

java - 不幸的是,App已停止(Android开发)

java - Java中JSON解析数组然后对象

php - 位置 :absolute; Making links not work in my div?

php - 如何进行跨域ajax调用