1

I maintain a GWT web application that uses 3 java servlets for file download/upload and data transfer. I had my servlet mapping sin place and have not touched them in months, just a few days ago I started receiving 404 errors when trying to access my servlets. I can't even seem to access the servlets by typing their full path from the WEB-INF/classes directory (ie /servlet/com/company/project/servletname).

Unfortunately these are running off of a shared hosting plan and I do not have access to starting or stopping tomcat or much of anything else. Before I issues a trouble ticket with my hosting provider I just wanted to check to see if my assumptions about servlets are correct and to see if there were any steps that I should follow for this type of situation.

Does tomcat need to be restarted in order to use a new servlet uploaded to the "WEB-INF/classes" directory? Does tomcat need to be restarted to read changes to the web.xml in the "WEB-INF" directory?

If I put a .class file at /WEB-INF/classes/foo/bar.class should I be able to access it immeidately via "http://www.mydomain.com/servlet/foo/bar" or do I need ot wait for tomcat to recognize this new class file? Or do I have to include it in the existing web.xml servlet mapping file?

Thanks for any help

snctln
  • 113
  • 5

1 Answers1

1

Does tomcat need to be restarted in order to use a new servlet uploaded to the "WEB-INF/classes" directory?

It depends, if your

Does tomcat need to be restarted to read changes to the web.xml in the "WEB-INF" directory?

It depends, if your

If I put a .class file at /WEB-INF/classes/foo/bar.class should I be able to access it immeidately via "http://www.mydomain.com/servlet/foo/bar" or do I need ot wait for tomcat to recognize this new class file?

No, the class will be available to the webapp classloader immediately, if your context is reloadable, see above.

Or do I have to include it in the existing web.xml servlet mapping file?

To access your class (assuming it extends HttpServlet) via HTTP, it will need a mapping in web.xml (assuming you are using straight http servlets)

Dave Cheney
  • 18,307
  • 7
  • 48
  • 56