Reputation: 2611
i have an external javascript and css file and i want to incude it into my JSP file so im trying to test this code but is not working :
i don't want to use "include file='file.css'"
<html>
<head>
<link href="css/bootstrap.min.css" rel="stylesheet"/>
<script src="js/jquery-latest.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<form class="form-horizontal well">
login : <input type="text">
<br/>
passw : <input type="password">
</form>
</body>
</html>
Upvotes: 1
Views: 22531
Reputation: 2165
Use
<link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet"/>
See http://docs.oracle.com/javaee/5/api/javax/servlet/http/HttpServletRequest.html#getContextPath%28%29
Upvotes: 6