Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use twitter bootstrap with Spring MVC

I can't understand why my Spring MVC 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:

enter image description here

Any ideas how to properly add bootstrap?

like image 330
user3279337 Avatar asked Mar 06 '14 16:03

user3279337


People also ask

How does Twitter use bootstrap?

Twitter Bootstrap is a front end framework to develop web apps and sites fast. In modern web development, there are several components which are required in almost all web projects. Bootstrap provides you with all those basic modules - Grid, Typography, Tables, Forms, Buttons, and Responsiveness.

Is twitter bootstrap the same as bootstrap?

There's no difference. Twitter Bootstrap was the official name for version 1.0 (Twitter Bootstrap). Later the name has been shortened.

Does Twitter make bootstrap?

Bootstrap is a toolkit from Twitter designed to kickstart development of webapps and sites. It includes base CSS and HTML for typography, forms, buttons, tables, grids, navigation, and more.

Is twitter bootstrap responsive?

Responsive designWith Bootstrap 2, we've gone fully responsive. Our components are scaled according to a range of resolutions and devices to provide a consistent experience, no matter what.


1 Answers

If you are using Springs framework you can add these line in dispatcher-servlet.xml

<mvc:resources mapping="/bootstrap/**" location="/resources/" />
like image 197
Manish Mahajan Avatar answered Sep 23 '22 01:09

Manish Mahajan