GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  J2EE
Go To First  |  Previous Question  |  Next Question 
 J2EE  |  Question 7 of 104    Print  
What is the right way of writing the code to get the servlet information using public String getServletInfo()?

  
Total Answers and Comments: 4 Last Update: January 11, 2008     Asked by: subhashree 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
November 16, 2005 19:30:02   #1  
barsana        

RE: What is the right way of writing the code to get t...
The information entered in Info attribute of page directive can then be accessed viagetServletInfo().
 
Is this answer useful? Yes | No
January 28, 2006 08:32:48   #2  
dilipiyer Member Since: January 2006   Contribution: 11    

RE: What is the right way of writing the code to get t...

getServletInfo() allows the servlet to return basic information about itself such as author version and copyright.
Usage:
servlet.getServletInfo() --> Inside doget(..)
Or
< getServletInfo() > --> Inside JSP


 
Is this answer useful? Yes | No
November 07, 2007 20:10:12   #3  
Vamsi        

RE: What is the right way of writing the code to get t...
ServeltContext context getServletContext();
Servlet s context.getServlet();
s.getServletInfo(); -----------> we can use this in the method

 
Is this answer useful? Yes | No
January 11, 2008 04:35:32   #4  
mabhijit Member Since: January 2008   Contribution: 5    

RE: What is the right way of writing the code to get the servlet information using public String getServletInfo()?
Some applets and applications for example the Java Web Server Administration Tool display information about a servlet. This information can include a short description of the purpose of the servlet its author and perhaps its version number. So the Servlet API provides a method to return this information getServletInfo. By default this method returns null. While servlet writers are not required to override this method it is strongly recommended.
e.g. : -

public class SimpleServlet extends HttpServlet
{ ...
public String getServletInfo()
{
return "A simple servlet";
}
}

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
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