Jsp-intermédiaire

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Anis ZOUAOUI
A
Anis ZOUAOUI
Community Contributor
Quizzes Created: 2 | Total Attempts: 898
| Attempts: 512 | Questions: 7
Please wait...
Question 1 / 7
0 %
0/100
Score 0/100
1. Which is the life-cycle procedure?

Explanation

The correct answer is "class loading => constructor call => init() => service() => destroy()". This sequence represents the life-cycle procedure in which a class is loaded, the constructor is called, the init() method is invoked, followed by the service() method, and finally the destroy() method.

Submit
Please wait...
About This Quiz
Jsp-intermédiaire - Quiz

Tell us your name to personalize your report, certificate & get on the leaderboard!
2. What is the meaning of response.setIntHeader("xyz" ,67); ?

Explanation

The method response.setIntHeader("xyz", 67) is used to set the value of a header named "xyz" to the integer value 67. This method will either replace the existing value of the header if it already exists, or add a new header with the integer value if it doesn't exist.

Submit
3. Which statement is not true about ServletContext?

Explanation

The statement "There is one ServletContext per one servlet" is not true about ServletContext. ServletContext is a web application's execution environment and there is only one instance of ServletContext per web application, not per servlet. It provides a way to share data and communicate between servlets and other components within the same web application.

Submit
4. What is true about MIME type?

Explanation

The MIME type is a standardized way to indicate the type of data that is being sent over the internet. In this case, the correct answer states that the MIME type tells the browser what type of data it will receive. This means that the MIME type is used by the server to inform the browser about the format or structure of the data being sent, allowing the browser to interpret and display the data correctly.

Submit
5. Which tag doesn't belongs to web.xml?

Explanation

The tag "servlet-mappings" does not belong to web.xml. The web.xml file is used in Java web applications to configure the deployment settings and mappings for servlets. It includes tags such as "web-app" to define the web application, "welcome-file-list" to specify the default page, and "servlet" to define servlets. However, "servlet-mappings" is not a valid tag in web.xml.

Submit
6. Through which tag you can define servlet config  in web.xml?

Explanation

The correct answer is "init-param". In the web.xml file, the "init-param" tag is used to define configuration parameters for a servlet. These parameters can be accessed by the servlet using the getInitParameter() method. The "config-param" tag does not exist in the web.xml specification, making it an incorrect option. The "context-param" tag is used to define configuration parameters for the entire web application, not for a specific servlet. Therefore, it is also an incorrect option. The option "None" is not a valid tag to define servlet config in web.xml.

Submit
7. How the web-application get servlet context ?

Explanation

All of these options can be used to obtain the servlet context in a web application. The getServletContext() method returns the ServletContext object, which can be used to access various resources and information about the application. The getServletConfig() method returns the ServletConfig object, which can also be used to access the servlet context. The this.getServletConfig() is another way to access the ServletConfig object. Therefore, all of these options are valid ways to obtain the servlet context in a web application.

Submit
View My Results

Quiz Review Timeline (Updated): Jul 22, 2024 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Jul 22, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Dec 29, 2015
    Quiz Created by
    Anis ZOUAOUI
Cancel
  • All
    All (7)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Which is the life-cycle procedure?
What is the meaning of response.setIntHeader("xyz" ,67); ?
Which statement is not true about ServletContext?
What is true about MIME type?
Which tag doesn't belongs to web.xml?
Through which tag you can define servlet config  in web.xml?
How the web-application get servlet context ?
Alert!

Advertisement