Note that there are some explanatory texts on larger screens.

plurals
  1. PODemo simple Ajax ans Servelt implementation fails
    primarykey
    data
    text
    <p>I am trying to demo simple Ajax/Servlet request.For this i have created a new Dynamic web project in eclipse and added a simple Servlet to take the request and present the same back to UI. I have included my Servlet details in web.xml. I am using Tomcat as my server. No Build scripts yet(i felt not needed at this point)</p> <p>Servlet Code: </p> <pre><code>response.setContentType("text/html"); PrintWriter out =response.getWriter(); String txt = request.getQueryString(); out.println(txt); </code></pre> <p>Js Code:</p> <pre><code>$(function(){ $.get('/jirarequest','OK',function(op){ $('#maindiv').appendTo(op); }); }); </code></pre> <p>Html Code:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"&gt; &lt;display-name&gt;Jira-Synchronization&lt;/display-name&gt; &lt;welcome-file-list&gt; &lt;welcome-file&gt;index.html&lt;/welcome-file&gt; &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt; &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;welcome-file&gt;default.html&lt;/welcome-file&gt; &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt; &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;servlet&gt; &lt;servlet-name&gt;JiraSyncServlet&lt;/servlet-name&gt; &lt;servlet-class&gt;src.JiraSyncServlet&lt;/servlet-class&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;JiraSyncServlet&lt;/servlet-name&gt; &lt;url-pattern&gt;/jirarequest/*&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; </code></pre> <p></p> <p>My Project structure:<img src="https://i.stack.imgur.com/7Rhug.png" alt="enter image description here"></p> <p>My HTML:</p> <p><img src="https://i.stack.imgur.com/kxh4y.png" alt="enter image description here"></p> <p>I am getting a error in Fire bug saying </p> <pre><code>"NetworkError: 404 Not Found - http://localhost:8080/jirarequest?OK" </code></pre> <p>The URL i am using in browser is <code>http://localhost:8080/Jira-Synchronization/index.html</code>. i have double checked all kind of typo. I debugged by putting breaking point but the debugger never hit my Servelt. I am not sure what is wrong? URL is wrong or wiring is wrong or the way it set up something is missing?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload