How to configure the Project ( depends on maven/web.xml/servlet APi) AJAX
call not to include the Project name in it?
I am trying to deploy my WAR in TOMCAT server, and i am using MAVEN 2. My
Project name is "Jira-Synchronization". 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
$.getJSON('/Jira-Synchronization/jirarequest','OK', function(jiraData)
<?xml version="1.0" encoding="UTF-8"?><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">
<display-name>Jira-Synchronization</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>JiraSyncServlet</servlet-name>
<servlet-class>JiraSyncServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>JiraSyncServlet</servlet-name>
<url-pattern>/jirarequest/*</url-pattern>
</servlet-mapping>
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
http://localhost:8080/Jira-Synchronization/index.html).
When i tried to build it using maven and deploy in tomcat(out side of
eclipse) the War is made using this name
"Jira-Synchronization-0.0.1-SNAPSHOT. My URL has changed
tohttp://localhost:8080/Jira-Synchronization-0.0.1-SNAPSHOT/index.html 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
How should i configure my web.xml or pom.xml so that the ajax request
excludes the project name to it?
No comments:
Post a Comment