vraptor

How to link css


I am new to web design and am having some problems , one of them (which is killing me ) is that I can not link the css my JSP page . My problem is " simple " : 404 NOT FOUND in the css file.

Actually I got the code below : < % @ include file = " ../../ css / bootstrap.min.css " % > < / style> However , the q I understand , this is a code that means " brute force " pq copy all css to the HTML page .

I've tried the following methods :

- < Link href = " $ { } pageContext.request.contextPath /css/teste.css " rel = "stylesheet " type = "text / css " >

- < % @ Taglib prefix = " fmt " uri = " http://java.sun.com/jsp/jstl/fmt " % >
< % @ Taglib prefix = " c " uri = " http://java.sun.com/jsp/jstl/core " % >
...
<link href = " < c : url value = " / css / teste.css " / > " rel = "stylesheet " >

Solution

  • Create a folder inside webapps and call it resource you create folders for your css , js or images . To use, simply do:

    <link rel="stylesheet" href="<c:url value="/resources/css/yourfile.css"/>">