joesid joesid - 2 months ago 17
Java Question

Why bootstrap does not work in eclipse?

Why bootstrap does not work ? I download the folders from site and I add it in the root of the WebContent like WebContent/bootstrap/css..js..fonts

The jsp looks like this

<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet"
href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link href='http://fonts.googleapis.com/css?family=Roboto'
rel='stylesheet' type='text/css'>
<title>Comment Box</title>
<script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet"
type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<div class="row" id="featuresheading">
<div class="col-lg-12">
<div class="table-responsive">
<table class="table ta................etc


but why the table does not appear as it suposed? please help

Answer

Try a full publish to get your bootstrap files into your application server.
I got bootstrap to work in a .jsp in Eclipse. Here's my configuration:

Bootstrap in WebContent folder

Here's the markup in the .jsp...

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Test Bootstrap</title>
<link href="bootstrap-3.3.6/dist/css/bootstrap.css" rel="stylesheet"
    type="text/css" />
</head>
<body>
    <div class="container">
        <h1>Test Bootstrap</h1>
        <table class="table table-striped">
            <tr>
                <td>Bootstrap</td>
            </tr>
            <tr>
                <td>is working</td>
            </tr>
        </table>
    </div>
</body>
</html>`

`You don't need to reference bootstrap two times. Just pick the full or the minified version. Good luck.