title: jQuery not displaying on JSP page when called from servlet
body: <p>Hi I'm fairly new to jQuery and am trying to add a simple jQuery tab component to an existing jsp page which is called from a servlet.
  If I access the page directly, the jQuery components appear but when the page is called from the servlet the page displays but the jQuery effects dont work. It appears jQuery never gets called.</p>
  
  <p>Sample code below:</p>
  
  <p>I am just getting the following instead of the tabs effect</p>
  
  <pre><code>*Tabs
  
      * First
      * Second
      * Third
  
  This is tab one
  This is tab two.
  This is tab three*
  </code></pre>
  
  <p>Can anybody help, I have searched the web for days looking for answer but havent had any luck. Any help would be very much appreciated</p>
  
  <p>I have added an popup which appears when page called directly from browser but doesnt get called when page called from servlet</p>
  
  <h2>TestServlet</h2>
  
  <pre><code>public class SBServlet extends HttpServlet {
  
      public SBServlet()
      {
          super();
      }  
  
  
      protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
      {
  
          // redirecting to test.jsp
          getServletContext().getRequestDispatcher("/JSP/test.jsp").forward(request,response);        
  
      }
  
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
      {
            doPost(request, response);    
      }
  
  
  }
  </code></pre>
  
  <h2>test.jsp</h2>
  
  <pre><code>    &lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&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;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;link type="text/css" href="../css/hot-sneaks/jquery-ui-1.8.10.custom.css" rel="stylesheet" /&gt;  
  &lt;script type="text/javascript" src="../js/jquery-1.4.4.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="../js/jquery-ui-1.8.10.custom.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  
  $(document).ready(function() {
      alert('jQuery is accessible');
      $("#tabs").tabs();
    });
  
  
  &lt;/script&gt;
  
  
  &lt;title&gt;Jquery test&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;h2 class="demoHeaders"&gt;Tabs&lt;/h2&gt;
    &lt;div id="tabs"&gt;
  
      &lt;ul&gt;
        &lt;li&gt;&lt;a href="#tabs-1"&gt;First&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#tabs-2"&gt;Second&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#tabs-3"&gt;Third&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  
        &lt;div id="tabs-1"&gt;This is tab one&lt;/div&gt;
        &lt;div id="tabs-2"&gt;This is tab two.&lt;/div&gt;
        &lt;div id="tabs-3"&gt;This is tab three&lt;/div&gt;
    &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>