title: how to apply css files in servlet code written inside jsp file?
body: <p>Below is my code. I have all css files in webcontent root and inside css folder.</p>
  
  <pre><code>String cssLocation = request.getContextPath() + "/WebContent/css/style.css";
  String cssTag = "&lt;link rel='stylesheet'&lt;img class=gallery_img'&gt; type='text/css' href=' "+ cssLocation +" '&gt;";
  out.println("&lt;h4&gt; &lt;p&gt;&lt;div class='gallery_img'&gt; " + rs.getString("title") + "&lt;/div&gt;&lt;/div&gt;&lt;/P&gt;&lt;/h4&gt;");
  out.println("");
  out.println("&lt;a href='#'&gt;&lt;div style='float:left;width:10% border:10px solid;padding:20px ;'&gt;&lt;link rel='stylesheet' type='text/css' href='css/style.css'&gt;&lt;table style='width:50%' &gt;&lt;td&gt;&lt;img width='230' height='230' src=displayphoto?id=" +  rs.getString("id") + "  style='opacity: 1'&gt;&lt;/img&gt;&lt;/td&gt;&lt;/table&gt;&lt;/body&gt;&lt;/a&gt; &lt;p/&gt;");
  </code></pre>