Student Seminar Report & Project Report With Presentation (PPT,PDF,DOC,ZIP)

Full Version: Interview Questions & Answers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Interview Questions & Answers

[attachment=500]

1)What is a singleton class?How do you writer it? Tell examples?
A class which must create only one object (ie. One instance) irrespective of any number of object creations based on that class.
2) What is the difference between using HttpSeassion & a Stateful Session bean? Why can't HttpSessionn be used instead of of Session bean?
HttpSession is used to maintain the state of a client in webservers which are based on Http protocol. Where as Stateful Session bean is a type of bean which can also maintain the state of the client in Application servers based on RMI-IIOP
3)What is Temporary Servlet?
When we sent a request to access a JSP, servlet container internally creates a 'servlet' & executes it. This servlet is called as 'Temporary servlet'. In general this servlet will be deleted immediately to create & execute a servlet base on a JSP we can used following command.
Java weblogic.jspc—keepgenerated *.jsp
4) Generally Servlets are used for complete HTML generation. If you want to generate partial HTML's that include some static text (this should not be hard coded in servlets)
as well as some dynamic text, what method do you use?

Using 'RequestDispather.include(“xx.html”) in the servlet code we can mix the partial static HTDirectoryML page.
Ex:- RequestDispatcher rd=ServletContext.getRequestDispatcher(“xx.html”);
rd.include(request,response);
5)Difference between <jsp:forward> and <jsp:include> tags?
<jsp:forward> action tag redirect the servlet Request and Servlet Response to another resource specified in the tag. The path of the resource is 'relative path'. The output generated by current JSP will be discarded.
<jsp:include>action tag process the resource as part of the current jsp. It include the o/p generated by resource, which is specified in the Tag to the current JSP
*) In both the cases single Request proceses multiple resources.