Question: init method

Ads

 
 
 

Share on Google+Share on Google+

onkar vasagadekar
init method
2 Answer(s)      5 years and 10 months ago
Posted in : JSP-Servlet

why init method used in servlet?

Ads
View Answers

July 14, 2011 at 10:34 AM


The init() method is called only once by the servlet container throughout the life of a servlet. By this init() method the servlet get to know that it has been placed into service.



July 18, 2011 at 10:56 PM


and also init() method is one in servlet life cycle methods. lifecycle methods of servlet. 1)init() 2)service(request,response) 3)destroy() init() is initialisation of servlet class.and also all resource initialization code like jdbc connection creation code are wrote inside the init()method .and also all initparams in web.xml we can get through config object.by passing that object into init(config).but for resource initialization here mean inside init() is not good practice said by experts.now a days almost this init(config)method using in realtime for counting how many times user entered or hit the webpage.not only that all web.xml init params are placed in config object passed through init()method .from here all init params we can collect or read.or for counter purpose also we use init().


Ads









Related Tutorials/Questions & Answers:
init method
init method  why init method used in servlet?   The init() method is called only once by the servlet container throughout the life of a servlet. By this init() method the servlet get to know that it has been placed
Servlet Init method
Servlet Init method  can we capture the form data into the init method of the servlet
Advertisements
init method of ActionServlet and RequestProcessor
init method of ActionServlet and RequestProcessor  hi every when the ActionServlet init() method is executed? please give answer for the above query
init Method in Spring
init Method in Spring       Calling Bean using init() method in Spring, this section describes ... the init method as shown below:- <bean id="mybean" class
Why servletcontainer can,t call the Init() method ?
Why servletcontainer can,t call the Init() method ?  Why servletcontainer can,t call the Init() method
init Method in Spring
init Method in Spring       Calling Bean using init() method in Spring, this section... the init() method .Here we have defined the property and values of  the bean
init Method in Spring
init Method in Spring       Calling Bean using init() method in Spring, this section describes ... the init method as shown below:- <bean id="mybean" class
Counter in Init() Method
: #000000; } Counter in Init() Method     .... In this program we are going to make use of the init method of the Servlet interface... which will have the initial value of the counter. The init() method accepts
Init Parameter
Init Parameter  How set Init Parameter in servlet
difference between init() & init(ServletConfig config)?
difference between init() & init(ServletConfig config)?  I want to know the difference between init() and init(ServletConfig config) methods in GenericServlet
Access web.xml init parameters
Access web.xml init parameters  How to access web.xml init parameters from java code
Init param - Java Beginners
Init param  What is the correct syntax of init param?  Hello,Init parameters are added between the <init-param></init-param>...-name> <init-param> <param-name>emailHost</param-name>
Getting Init Parameter Names
on the browser. To retrieve all the values of the init parameter use method... Getting Init Parameter Names       In this example we are going to retreive the init paramater
help to load information in init of application - Struts
help to load information in init of application  Thanks for ur... question related to struts2 framework I want to keep some data in init... that is in init of the application , please remember, i am using struts2
What values initialized inside init() in servlet - Java Interview Questions
What values initialized inside init() in servlet  What will happen inside init() in servlet. my interviewer asked servlet lifecycle. i said "once servlet is loaded in to memory init() will be called which performs servlet
how to maKE Jcombox editable after saveing value init.
how to maKE Jcombox editable after saveing value init.  i have one JCombobox with 2 values"y", "N".when i selecting some value from dropdown... after saveing value init
method
method   how and where, we can define methods ? can u explain me with full programme and using comments
method
method  can you tell me how to write an abstract method called ucapan() for B2 class class A2{ void hello(){ system.out.println("hello from A2"); }} class B2 extends A2{ void hello(){ system.out.println("hello from B2
Methods of Servlets
(ServletConfig config) throws ServletException The init() method is called only...; The servlet cannot be put into the service if  The init() method does... a ServletException Parameters - The init() method takes a ServletConfig object
method inside the method??
method inside the method??  can't we declare a method inside a method in java?? for eg: public class One { public static void main(String[] args) { One obj=new One(); One.add(); private static void add
Method
Method       In this section, we will explore the concept of method in the reference of object oriented... and behaviors are defined by methods. Method : An brief introduction Methods
get method
get method   how to use get method: secure method is post method and most of use post method why use a get method
method question
method question  How do I figure out the difference in a method heading, a method body, and a method definition
Method Overloading
Method Overloading  In java can method be overloaded in different class
Method Overloading
Method Overloading  In java can method be overloaded in different class
A method getColumnCount.
A method getColumnCount.  There is a method getColumnCount in the JDBC API. Is there a similar method to find the number of rows in a result set
abstract method
abstract method  is final method is in abstract class
method name
method name  Is there any method which is equivalent to c++'s delay(int) function
gc() method
gc() method  what is difference between java.lang.System class gc() method and java.lang.Runtime class gc() method
Static method
Static method  what is a static method?   Have a look at the following link: Java Static Method
abstract method
abstract method  Can a concrete class have an abstract method
Tutorials   
Java Spring Hibernate Struts Training fat image from db fat image from db fat image from db fat image from db unable to get value returned from javascript variable in page How to change image size before adding to mysql using jsp Design a registration.jsp page with input for user registration details Cart Quantity jsp servlet coding issue servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? image pdf marking pdf marking Multiple image upload using JSP Read code from excel sheet and upload into database using JSP Student java about search engine Convert BLOB to PDF and save it to a location how to copy files from remote to local machine using SFTP SSL in java? Like Team viewer Socket and Servert -Jsp how to copy files from remote location to local using java? How To Store Multilple Images In MySQL database dynamically with image uploader and then retrieve them in image gallery using java how to create SOAP based web service in java? how to fetch data from mysql database table and draw a bar chart on that data using in jsp how to create users in LDAP using java? how to authenticate user using TIVOLI api in java? how to create users using IBM Tivoi API in jsp/servelet? Java/J2ee Please explain this code as many packages and classes are unknown to me .! how to download the uploaded folder files using jsp Login Query image is display from path of mysql database please reply the code to store dynamic fields in database? Reloading issue in jsp How to get Button Id ? calling one jap page from another jsp page login login Problem to get connection from DAO class to JDBC Page Loading Time Fix table's column's name row(1st row of the table) so that it does not move up when the table is scrolled up to view more rows below Sending hidden values

Ads

 
Advertisement null

Ads