I have the following setup. The folder itext is in the top level in webapps:
├───itext
│ └───WEB-INF
│ ├───classes
│ │ └───com
│ │ └───imparator
│ │ └───ist
│ └───lib
In the web-inf folder I have a web.xml file where I do the servlet mapping:
<servlet>
<servlet-name>Itext Servlet</servlet-name>
<servlet-class>com.imparator.ist.ItextServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Itext Servlet</servlet-name>
<url-pattern>/fincc-itext</url-pattern>
</servlet-mapping>
Now when I want something to be served by this servlet here is my action attribute in a form:
<form method="POST" action="/itext/fincc-itext">
========================================================================================
Now, suppose that the itext folder was not in the top level folder in webapps but a couple of levels below:
├───level1
│ └───level2
│ └───itext
│ └───WEB-INF
│ ├───classes
│ │ └───com
│ │ └───imparator
│ │ └───ist
│ └───lib
How do I update the servlet mapping and the action attribute value to correspond to this directory structure?
Those won’t change unless the context changes. The context is itext since that’s where you WEB-INF is.