Following method(s) cannot be overridden in the JSP page.

  1. jspDestroy()

  2. jspInit()

  3. _jspService()

  4. getParameter()


Correct Option: C

AI Explanation

To answer this question, we need to understand the concept of JSP (JavaServer Pages) and method overriding.

JSP is a technology used to create dynamic web pages. It allows for the separation of HTML code from Java code, making it easier to develop and maintain web applications.

In JSP, we can override certain methods to customize the behavior of the JSP page. However, not all methods can be overridden. Let's go through each option to understand why it is correct or incorrect:

Option A) jspDestroy() - This option is incorrect. The jspDestroy() method is part of the JSP life cycle and can be overridden to perform cleanup tasks when the JSP page is being destroyed.

Option B) jspInit() - This option is incorrect. The jspInit() method is part of the JSP life cycle and can be overridden to perform initialization tasks when the JSP page is being initialized.

Option C) _jspService() - This option is correct. The _jspService() method is automatically generated by the JSP container and cannot be overridden. It is responsible for handling the HTTP requests and generating the dynamic content of the JSP page.

Option D) getParameter() - This option is incorrect. The getParameter() method is not related to method overriding in JSP. It is a method of the HttpServletRequest class, which is used to retrieve the values of request parameters.

The correct answer is C) _jspService(). This option is correct because the _jspService() method cannot be overridden in JSP.

Find more quizzes: