Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to configure the Project ( depends on maven/web.xml/servlet APi) AJAX call not to include the Project name in it?
    text
    copied!<p>I am trying to deploy my WAR in TOMCAT server, and i am using MAVEN 2. My Project name is "<strong>Jira-Synchronization</strong>". My project is a simple Ajax call and returns result to display to the user. I have only one page( that's the scope of my project). This is how i made the Ajax call and web.xml</p> <pre><code>$.getJSON('/Jira-Synchronization/jirarequest','OK', function(jiraData) &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;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>if you notice the ajax call is taking the Project name( first i felt weired why it is doing that and to move on with the project i just kept it that way) and every thing worked fine inside eclipse running tomcat(This is the URL i used when running from eclipse <code>http://localhost:8080/Jira-Synchronization/index.html</code>).</p> <p>When i tried to build it using maven and deploy in tomcat(out side of eclipse) the War is made using this name "<strong>Jira-Synchronization-0.0.1-SNAPSHOT</strong>. My URL has changed to<code>http://localhost:8080/Jira-Synchronization-0.0.1-SNAPSHOT/index.html</code> and now my Ajax call which have my project name in it is also need to be changed. this is how my pom.xml looks like</p> <p><img src="https://i.stack.imgur.com/LQ59H.png" alt="enter image description here"></p> <p>How should i configure my web.xml or pom.xml so that the ajax request excludes the project name to it?</p>
 

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