GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  J2EE
Go To First  |  Previous Question  |  Next Question 
 J2EE  |  Question 8 of 104    Print  
How to write into the webcontainer and see those messages using public void log(String msg) and public void log(String msg ,Throwable t)?

  
Total Answers and Comments: 2 Last Update: May 16, 2007     Asked by: subhashree 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
November 17, 2005 07:13:27   #1  
amit        

RE: How to write into the webcontainer and see those m...

container call servlet 's life cycle init() method in which we can define log() method .

init() method initialize the variables and method at run time.


 
Is this answer useful? Yes | No
May 16, 2007 10:29:26   #2  
ajay kumar        

RE: How to write into the webcontainer and see those m...
You can use log4j

here s a sample code

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;


public class MyClasss extends HttpServlet {
private static final Logger ActionLOG Logger.getLogger(MyClass.class);
protected void service(HttpServletRequest req HttpServletResponse resp)
throws ServletException java.io.IOException{
ActionLOG.info( nnn******data is updating to application context****** );
...........................................................



 
Is this answer useful? Yes | No

 Related Questions

What is the right way of writing the code to get the servlet information using public String getServletInfo()?
Read Answers (4) | Asked by : subhashree

How to write into the webcontainer and see those messages using public void log(String msg) and public void log(String msg ,Throwable t)?
Read Answers (2) | Asked by : subhashree

If a simple application is to be developed using Java, JSP, EJBs, Servlets, JDBC, XML in eclipse IDE What are the steps involved in it. Explain briefly step by step. 
View Question | Asked by : sateeshm1


 Sponsored Links

 
Related Articles

C++ Void Pointer and Null Pointer

C Void Pointer and Null Pointer In this C tutorial you will learn about two interesting types of pointers; void pointers and Null Pointer These pointers will be discussed in conjunction with syntax usage and example mosgoogle center Pointer to Void General Syntax void pointer variable; Void is use
 

C++ String Representation and Handling

C String Representation and Handling In this C tutorial you will learn about string representation and handling how is string represented end string notation initializing char array character representation string literals example programe to understand the character array concept and the accessing
 

JavaScript String Object

JavaScript String Object In this JavaScript tutorial you will learn about String Object purpose of string object in JavaScript purpose of string object indexof method lastIndexOf method and substring method along with syntax and example mosgoogle center Purpose of String Object in JavaScript The mai
 

Convert a String into an Integer

How to convert a string into an integer in C program? This is done by using the function named as atoi(). This function atoi() is present in the header file named as <stdlib.h>. When programmers use this function they must include the header file by the statement #include <stdl
 

String handling functions

What is the string handling functions present in header file <string.h>? There are number of string handling functions present in string.h. In other words if a programmer uses any of the function present in string.h then they must include the header file as #include <string.h&am
 

Convert a String into Long Value

What string function is used to convert a string into long value? This is done by using the function named as atol() . This function atol() is present in the header file named as <stdlib.h>. When programmers use this function they must include the header file by the statement
 

Base Address of the String

What happens when we try to change the value of base address of the string? The base address of the sting takes a special place in the context of strings. This is because suing this base address only the string gets identified. In other words the base address therefore takes the position of constant
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

Winning a Job Interview with a Winning Resume

Does your resume unlock your potential, take your skills to the highest level and win you the interview and the job you want now? The job market today is highly competitive and even if you think you have what it takes to get an interview you won’t get over the line without a polished, prof
 

Importance of Proper English during Job Interview

Importance of Proper English during Job Interview Your job interview is crucially important and it will determine whether or not you will get the job Depending on the type of job you re going for it is very important for you to use proper English In most cases jobs which offer higher salaries will h
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape