I’m writing a web.xml to deploy my Java servlet. The .war file is copied to a directory called “/myname/servletname” on the server. I’m trying to access the servlet at server.com:8080/myname/servletname
Web.xml is as follows currently
<servlet>
<servlet-name>servletname</servlet-name>
<servlet-class>connect4.GameBoardBean</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>servletname</servlet-name>
<url-pattern>myname/servletname</servlet-name>
And the copy routine for the war file in build.xml:
<copy file ="servletname.war" todir = "/opt/jboss/server/default/deploy/myname"/>
I’m getting a 404 error when trying to access the URL. Any help is appreciated.
As far as I see it, myname is the context path. So it shouldn’t be in the mapping. Keep only /servletname in web.xml