title: JavaScript and CSS not working in my liferay portlet
body: <p>I have to use some JavaScript and CSS for my portlet. I am using some datable jQuery for sorting and some interactive display, but it's not working.</p>
  
  <p>Can anyone guide me to where I am making a mistake?</p>
  
  <p>This is my directory structure of docroot where my JS and CSS is kept.</p>
  
  <p><img src="https://i.stack.imgur.com/dq3fr.jpg" alt="enter image description here"></p>
  
  <p>Here is my view.jsp file in which am filling data dynamically.</p>
  
  <pre><code>&lt;%@page import="com.video.util.VideoActionUtil"%&gt;
  &lt;%@page import="com.video.database.model.Video"%&gt;
  &lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"
      import="com.video.database.model.Video.*"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Applying JQuery DataTables plugin in the Java Server application&lt;/title&gt;
  
       &lt;link href="docroot/js/jquery-1.2.6.min.js" type="text/javascript"&gt;
          &lt;link href="docroot/css/demo_page.css" rel="stylesheet" type="text/css" /&gt;
          &lt;link href="docroot/css/demo_table.css" rel="stylesheet" type="text/css" /&gt;
          &lt;link href="docroot/css/demo_table_jui.css" rel="stylesheet" type="text/css" /&gt;
          &lt;link href="docroot/css/jquery-ui.css" rel="stylesheet" type="text/css" media="all" /&gt;
          &lt;link href="docroot/css/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" media="all" /&gt;
          &lt;script src="docroot/js/query.js" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script src="docroot/js/jquery.dataTables.min.js" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;
          $(document).ready(function () {
              $("#companies").dataTable({
                  "sPaginationType": "full_numbers",
                  "bJQueryUI": true
              });
          });
          &lt;/script&gt;
      &lt;/head&gt;
      &lt;body id="dt_example"&gt;
          &lt;div id="container"&gt;
  
              &lt;div id="demo_jui"&gt;
                  &lt;table id="companies" class="display"&gt;
                      &lt;thead&gt;
                          &lt;tr&gt;
                              &lt;th&gt;Company name&lt;/th&gt;
                              &lt;th&gt;Address&lt;/th&gt;
                              &lt;th&gt;Town&lt;/th&gt;
                          &lt;/tr&gt;
                      &lt;/thead&gt;
                      &lt;tbody&gt;
                          &lt;% 
                          long l=10154;
                          for(Video c: VideoActionUtil.getAllVideo(l)){ %&gt;
                            &lt;tr&gt;
                              &lt;td&gt;&lt;%=c.getTitle()%&gt;&lt;/td&gt;
                              &lt;td&gt;&lt;%=c.getDescription()%&gt;&lt;/td&gt;
                              &lt;td&gt;&lt;%=c.getTypeId()%&gt;&lt;/td&gt;
                            &lt;/tr&gt;
                          &lt;% } %&gt;
                      &lt;/tbody&gt;
                  &lt;/table&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Maybe it can't locate the CSS and JavaScript?
  I have tried with the path  <code>href=/css/[filename]</code>  but this also doesn't work so I have given <code>docroot/css/ [filename]</code>.</p>
  
  <p>Thanks and Regards
  Bhavik Kama</p>
  
  <p>@ Mr. Barmar</p>
  
  <pre><code> &lt;script src="../js/jquery-1.2.6.min.js" type="text/javascript"&gt;&lt;/script&gt;
          &lt;link href="../css/demo_page.css" rel="stylesheet" type="text/css" /&gt;
          &lt;link href="../css/demo_table.css" rel="stylesheet" type="text/css" /&gt;
          &lt;link href="../css/demo_table_jui.css" rel="stylesheet" type="text/css" /&gt;
          &lt;link href="../css/jquery-ui.css" rel="stylesheet" type="text/css" media="all" /&gt;
          &lt;link href="../css/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" media="all" /&gt;
          &lt;script src="../js/query.js" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script src="../js/jquery.dataTables.min.js" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;
  </code></pre>