Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to place Twitter Bootstrap Files in a maven project?

I starting out to create something using Twitter Bootstrap & Spring MVC. Can someone tell me where to place the Bootstrap CSS/JS/HTML files in a maven project structure?

My JSP page shows up fine. But, it's not able to get a hold on the CSS & JS files.

<link href="..resources/css/bootstrap.css" rel="stylesheet">
<link href="../resources/css/bootstrap-responsive.css" rel="stylesheet">

enter image description here

like image 998
AppSensei Avatar asked Mar 20 '13 16:03

AppSensei


2 Answers

You could use Web Jars to bring them in as a Maven dependency. This gives you all the benefits of the Maven dependency management. The documentation page details how to use the resources in your app.

like image 88
Leesrus Avatar answered Nov 15 '22 21:11

Leesrus


The "src/main/resources" folder is for resources that get copied and integrated with the compiled Java code in the resulting artifact (in this case, the WAR under "WEB-INF/classes").

The "src/main/webapp" folder represents the root of your web content. You'll need to add those web content resources there for them to be available to the JSP(s).

like image 21
lotz Avatar answered Nov 15 '22 21:11

lotz