Tuesday, November 29, 2011

What is the difference between a normal servlet and action servlet?

Both a normal servlet and action sevlet are same, which extend HttpServlet and implement the servlet lifecycle methods..:we will define the action servlet in web.xml and <url-pattern> as *.do:Normal Servlet and Action servlet are same but Action servlet consists of logic for forwarding the request to corresponding action class:Both r used for controlling purpose,but Normal servlet is servlet :There is some difference between normal servlet and ActionServlet.:Normal Servlet extends from Servlet or HttpServlet, but Action Servlet class extends from ActionServlet. ActionServlet must have the execute method to forward the request to some action class.:normal and actionServlet both extends HttpServlet,in normal servlet there is no execute method,normal servlet is user defined class but action servlet is predefined:What is the difference between a normal servlet and action servlet?:Normal servlet and Action both basically same only difference is that action servlet consists of logic for forwarding the request to corresponding action class. and one is also action servlet execute mathod.:actionservlet is a singleton java class.some servers like web logic not follow the servlets specification bcz 300 req gives simultaneously it creates a new servlet obj at thar time servelt specifiation is failure .i.e single instance multiple thread concept :Normal Servlet extends from Servlet or HttpServlet, but Action Servlet class extends from ActionServlet. ActionServlet must have the execute method to forward the request to some action class.:Actionservlet is not a servlet but it act as a servlet,actionservlet is singleton but servlet may or may not be singleton.:Actionservlet is not a servlet but it act as a servlet,actionservlet is singleton but servlet may or may not be singleton.:both actionservlet and normal servlet are servlets only but actionservlet acts as frontcontroller for forwarding request to specific actionclass in struts programmimng:Action Servelt is a singleton(one instance many threads)but normal servlet is not a Singleton. Action servlet implements the Front controller design pattern implies multiple requests sent to single action servlet. in the web.xml the <url-pattern> is *.do all the requests those end with .do will be sent to this servlet this servlet process the request and forwards the request to the appropriate action class and Action form.:Servlet is follows Front Controller design pattern.but:both are used for controlling purpose.That&
Category:Struts Interview Questions

No comments:

Post a Comment