I have an old
servlet application which used old servlet API. The URL was like :
http://server/servlet/MyServlet . Now I upgraded the server and reorganized the file struture so the new URL is :
http://server/myapp/servlet/MyServlet, in which I created an application called "myapp" and put all .class in myapp/WEB-INF/classes/.
Now I want the old link to be automatically redirected to the new link. I want to use <servlet-mapping> and here is how I tried --
<servlet>
<servlet-name>MyServlet</servlet-name>
<servlet-class>Myservlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/servlet/MyServlet</url-pattern>
</servlet-mapping>
But it does NOT work. Can somebody help ?
Thanks.