I have a question regarding a servlet placed in a default package.
Under web-xml, I am supposed to map the servlets.
What do I key in under in eclipse if the servlet is in the default package?
I understand that all classes should be put in proper packages but the above is a practice question.
Could anyone let me know as I cant seem to find the answer on the internet.
Let's assume your Servlets class is "HelloTest" and name is hello, Then Web.xml entry should be
<servlet> <servlet-name>hello</servlet-name> <servlet-class>HelloTest</servlet-class> </servlet>
Also Please check This post also
The entry in the web.xml should be like this,
<servlet> <servlet-name>Test</servlet-name> <servlet-class>Test</servlet-class> </servlet> <servlet-mapping> <servlet-name>Test Servlet</servlet-name> <url-pattern>/test/*</url-pattern> </servlet-mapping>
You can follow this article for further details http://www.eclipse.org/webtools/community/tutorials/BuildJ2EEWebApp/BuildJ2EEWebApp.html