Use the constructor, instead of init, JAVA Programming

Assignment Help:

Can we use the constructor, instead of init(), to initialize servlet?

Ans) Yes. Of course you can use the constructor instead of init(). There's nothing to stop you. But you shouldn't. The main reason for init() was that ancient versions of Java couldn't dynamically invoke constructors with arguments, so there was no way to give the constructor a ServletConfig. That no longer applies, but servlet containers still will only call your no-arg constructor. So you won't have access to a ServletConfig or ServletContext.

 


Related Discussions:- Use the constructor, instead of init

Prepare simple spring maven task, Prepare Simple spring maven task Proje...

Prepare Simple spring maven task Project Description: We want a very simple delivery for one of our tasks using Spring STS Maven project. This chat does not have UI interf

Explain what is fontmetrics in java, Explain what is FontMetrics in Java? ...

Explain what is FontMetrics in Java? No word wrapping is completed when you draw a string in an applet, even if you embed newlines in the string along with \n. If you expect th

Develop contact list application, Develop Contact list application Proje...

Develop Contact list application Project Description: Prepare a computer application to help employees manage their contact list. Users must be able to store two kinds of con

Travelling salesman animation, how to implement tsp problem using java appl...

how to implement tsp problem using java applet to present in form of visulation

The software or script to scan automotive ads, The software or script to sc...

The software or script to scan automotive ads Project Description: Looking for a company that made the script or application to search through pages of listings of automotive

What is jms client, An application or procedure that produces and/or receiv...

An application or procedure that produces and/or receives messages.

Explain pop, SMTP (Simple Mail Transfer Protocol) permits two mail servers ...

SMTP (Simple Mail Transfer Protocol) permits two mail servers to communicate using a easy language, and gives a step-by-step protocol for exchanging information. SMTP delivers m

What is the use of throws keyword, What is the use of throws keyword ? ...

What is the use of throws keyword ? Rather than explicitly catching an exception you can declare in which your method throws the exception. This passes the repsonsibility to h

Padovan series, write a program in java using array and scanner class to ge...

write a program in java using array and scanner class to generate padovan series

Work is about 25% done but I am stuck, Modify the client server application...

Modify the client server application developed for phase 1 IP2 to be a Multithreaded Server (i.e. the server can handle concurrent requests from more than one client). Submit your

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd