Top 250+ Solved Advanced JAVA MCQ Questions Answer

From 166 to 180 of 223

Q. The life cycle of a servlet is managed by

a. servlet context

b. servlet container

c. the supporting protocol (such as http or https)

d. All of the above

  • b. servlet container

Q. Which of the following code is used to get an attribute in a HTTP Session object inservlets?

a. session.getAttribute(String name)

b. session.alterAttribute(String name)

c. session.updateAttribute(String name)

d. session.setAttribute(String name)

  • a. session.getAttribute(String name)

Q. A deployment descriptor describes

a. Web component response settings

b. Web component setting

c. Web component request objects

d. All of the above

  • b. Web component setting

Q. The values of <servlet-name> and <servlet-class> in web.xml file

a. must be same

b. must not be same

c. may be same

d. None of the above

  • c. may be same

Q. Which one is the correct order of phases in JSP life cycle?

a. Initialization, Cleanup, Compilation, Execution

b. Initialization, Compilation, Cleanup, Execution

c. Compilation, Initialization, Execution, Cleanup

d. Cleanup, Compilation, Initialization, Execution

  • c. Compilation, Initialization, Execution, Cleanup

Q. Which technology do we mix our business logic with the presentation logic?

a. Servlet

b. JSP

c. Both A and B

d. None of the above

  • a. Servlet

Q. Which attribute specifies a JSP page that should process any exceptions thrown but not caught in the current page?

a. The ErrorPage Attribute

b. The IsErrorPage Attribute

c. Both A & B

d. None of the above

  • a. The ErrorPage Attribute

Q. Which of the following is an advantage of the statement – Separation of business logicfrom JSP ?

a. Custom Tags in JSP

b. JSP Standard Tag Library

c. All the above

d. None of the above

  • a. Custom Tags in JSP

Q. Which is the Microsoft solution for providing dynamic Web content?

a. ASP

b. JSP

c. Both A and B

d. None of the above

  • a. ASP

Q. Which tag is used to execute java source code in JSP?

a. Declaration Tag

b. Scriptlet tag

c. Expression tag

d. None of the above

  • b. Scriptlet tag
Subscribe Now

Get All Updates & News