Wednesday, January 14, 2009

JSP Interview

JSP Interview

v What are the steps involved in creating an EJB?

v Types of EJB’s. describe each.

v Life cycle of a servlet?

v How to use java beans in a jsp? Ans. <usebean:>

v What is the parameter that is passed to the init method of the servlet?

v Ans. ServletConfig object

v You have a servlet with an init method, dopost method doget method and service method. If

the type of request sent from the HTML page is POST wht is the order of execution of

methods in the servlet?

v Diff between <jsp:include> and include directive.

v How are methods defined in JSP? Ans. <%! %>

v Diff include and send redirect .

v Diff between PreparedStatement and Statement?

v How do u access the session object in JSP? Ans. PageContext.getSession();

v Diff between naming.bind() and naming.rebind()? Ans. Gain access to output parameters sent

by stored procedure.

v What is the significance of init, service and destroy methods in a servlet?

v Should all the methods defined in Remote Interface throw Remote Exception?

v Which method is used to get the output stream to write the output to the client? Ans.

response.getOutputStream()

v Which method is used to get the IP address of the client sending the request? Ans.

request.getRemoteAddress()

v How to access an implicit variable “exception” in a JSP?

v Ans. set “isErrorPage” attribute in the page directive to “true”.

v In case of RMI what has to be present at the client side: RemoteInterface, Skeleton or stub?

v What are the constraints for objects that can be sent as parameters or return types in RMI?

Should it be ‘final’, ‘abstract’ and should it implement ‘Serializable’ class?

v Write a program to read a file and write into the other?

No comments:

Post a Comment