• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ServletContext object

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
The ServletContext object are accessible from which of the following objects?
Please select three correct answers.
A.HttpServlet
B.GenericServlet
C.HttpSession
D.ServletConfig
E.ServletResponse


Here i have selected A,B and D answer.but they told A,C and D is the answer.Please anybody clear this doubt.I am waiting for the updates.
 
Ranch Hand
Posts: 893
Tomcat Server Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The method from the HttpSession exists but is depreciated from version 2.1 and should not used anymore.

Generic servlet is a abstract class and can not be initialized but implements the servlet interface. The HttpServlet uses the inherited method from Generic Servlet for getting the ServletContext getServletContext.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The method from the HttpSession exists but is depreciated from version 2.1 and should not used anymore.


Is it ? Please check that statement again.
 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ServletContext object can also be obtained from
public ServletContext getContext(java.lang.String uripath) method in the
ServletContext interface
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic