News:

MyKidsDiary.in :: Capture your kids magical moment and create your Online Private Diary for your kids

Main Menu

Servlet Interview Questions & Answers

Started by sajiv, Aug 13, 2008, 03:41 PM

Previous topic - Next topic

sajiv




-What is pure servlet?
Pure Servlet is a java Object that provides the implementation of Interface called asjavax.servlet.Servlet

-How can we refresh the servlet for every 2 minutes automatically?

We can Refresh Servlet Page by two ways.One through client side and another through server side.
Through Client Side : We use Meta http refresh
< META HTTP-EQUIV="Refresh" CONTENT="5; URL=/servlet/MyServlet/">
Through Server Side : Use Server Push


-What is servlet ,what is the use of it?
Servlet is a technology implemented based on a different servers according to different protocals.
servlets are used to implentent dynamic webapplications.
Servlet is the technology used to define the server side application ,that will work on client-server architecture,request-response architecture.


-How to build struts in java?What are the function of struts?

To build struts in Java, we need the struts taglib. They provide many of the inbuilt tags that provide the many activities like loop,tiles(to beautify the page) etc. For this the struts.jar file has to be in the classpath. Any jsp engine will then apply the struts.This is mainly the web platform to develop the dynamic pages.

-Why we use static method in Business Logic?

Its a good design practice to implement the business logic in static methods.1. static method access is faster, you don't have to create, initialize the instance. 2. you perform some action/manipulaton on the input data and return the result, so why to make it a bulky object, keep it simpler.3. For holding data you have Beans/Data Objects and for holding client information you have session objectThe nature of the business logic implementation should be generic, i.e. it should not depend upon any pre-condition like initializing some variables, etc. For that use Facade or Validators, or context objects.


:acumen