difference between using the ActionServlet and the user defined Servlet
843838Mar 3 2006 — edited Mar 4 2006Hi,
I m having a strange problem that i really need to solve. I m having a tomcat project that works just fine when i define the servlet class in the web.xml as follows
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
..................
.........
</servlet>
But when I use my own Servlet, leaving all the project as it is, just changing the servlet name and class in the web.xml
<servlet>
<servlet-name>BSJServlet</servlet-name>
<servlet-class>BSJServlet</servlet-class>
..................
.........
</servlet>
it throws this error
javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:845)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:778)
org.apache.jsp.forms.signup1_jsp._jspService(org.apache.jsp.forms.signup1_jsp:89)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Do I have to do ANY changes when using my own servlet?? other than just defining it in the web.xml
Here s my Servlet
public class BSJServlet extends HttpServlet{
Connection dbConnection;
ArrayList countries = new ArrayList();
public void init()
{
System.out.println(getServletName() + " : Initalizing...... BSJ PROJECT");
}
}
Is the problem resides in it?? is it missing anything?
and again I just wanted to confirm, when i just change the servlet i m using to be org.apache.struts.action.ActionServlet in the servlet class tag in the web.xml the project run successfully with no problem
anyone has any idea about that?
thanks a lot