Question
Why to use the HttpServlet Init method to perform expensive operations that need only be done once

Answers

Because the servlet init() method is invoked when servlet instance is loaded, it is the perfect location to carry out expensive operations that need only be performed during initialization. By definition, the init() method is thread-safe. The results of operations in the HttpServlet.init() method can be cached safely in servlet instance variables, which become read-only in the servlet service method.   Your Comment




More Software,Java Questions..
What is the inputsplit in map reduce software?

Can variables be used in Java without initialization?

What is the difference between java bean and enterprise java bean?

What is software configuration management?

How does the java database connectivity (jdbc) work?

What are the advantages of threads in java?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

What is object cloning in Java?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?



Search
Can you Answer!!
  • Q What are the three different records used in object program?
  • Q One who lives both on land as well as in water
  • Q When has R a rough sound?
  • Q How do you verify if the EIGRP Non Stop Forwarding (NSF) feature is enabled?
  • Q Mention what are the common bugs found while mobile testing?
  • Q How would you make a physician to prescribe your medicine rather than that of the competitor?
  • Q how to Test Oracle Net Connections
  • Q The first country to win the World cup cricket thrice?
  • Q What is time series analysis?
  • Q What are various functions of rbi?
  • Q How with alloying of steel it is possible to a achieve properties which can not be achieved with heat treatment ?