javascripthtmljava-ee-6

why I cannot get the path of css and js file


I made a website project. But now i meet a problem. I cannot get the path of css and js file no matter what I do. Just like this:

<link type="text/css" rel="stylesheet" href="ckplayer/css/ckplayer.css" />
<script type="text/javascript" src="ckplayer/js/ckplayer.min.js" charset="UTF-8"></script>

And

<link type="text/css" rel="stylesheet" href="/ckplayer/css/ckplayer.css" />
<script type="text/javascript" src="/ckplayer/js/ckplayer.min.js" charset="UTF-8"></script>

And

<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}\ckplayer\css\ckplayer.css" />
    <script type="text/javascript" src="${pageContext.request.contextPath}\ckplayer\js\ckplayer.js" charset="UTF-8"></script>

What should I do?Any help would be appreciated.

The folder structure is as follow:

  1. ckplayer [1]: css (1)ckplayer.css [2]:js (1)ckplayer.js

2.pages [1]:video (1)video.jsp


Solution

  • Seems like your second try should work based on the folder structure you are showing. Hard to say for sure.

    If your page is at:

    /pages/video/video.jsp
    

    then

    /ckplayer/css/ckplayer.css
    

    looks correct as they both reference from the root.