This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, I have a question about using package for servlets. Suppose I have the following package structure: Inside the application directory my-app/, I want to put a java class myServlet.class which belongs to the package my-pack/, so I create the following structure: my-app/my.jsp my-app/WEB-INF/classes/my-pack/myServlet.class my-app/WEB-INF/web.xml What this is doing is to go from "my.jsp" and then click a SUBMIT button to go to "myServlet" page. But, the interesting thing I noticed is -- If I do NOT define "myServlet" in the <servlet> part of web.xml, it works fine. However, if I defined it, it failed. I tried the follwoing two ways to define the <servlet-calss> for "myServlet" a) <servlet-class> myServlet </servlet-class> b) <servlet-class> my-pack.myServlet </servlet-class> but none of them works. So, question is -- if we have packaged servlet, do we need to define them in the web.xml and how to reflect their package structure in the <servlet-class> part ? Thank, Ian