• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ServletContext, ServletConfig and Pagecontext

 
aakash bhatt
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the differnce between ServletContext, ServletConfig and Pagecontext?

Thanks,
aakash
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you read the documentation, which bits were you unsure about?
 
R K Singh
Ranch Hand
Posts: 5384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletContext : encapsulates all the information about the context in which all the Servlets are running.

ServletConfig : encapsulates the information about the configuration of the Servlet.

PageContext : encapsulates the information of context in which Page(jsp) is running in Servlet env.

Check this http://java.sun.com/j2ee/1.4/docs/api/index.html
 
Myra Rose
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone provide examples for all this?

Any help appreciated.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any book or tutorial on Servlets will cover these issuse, early on.
It wouldn't make much sense to type it into here.
 
Sri Vishnu Mandaleeka
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey

Servlet Context: Its the oject through which we can see entire weapplication.

ServletConfig: Its the oject which is applicale to a paticular servlet.

PageContext: its the oject which is available to the paticular JSP page.
I hope this works for U. But for examples and detailed soluton gofor HFSJ.


Vishnu
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope this works for U


Sri Vishnu,

JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "u" instead of spelling out "you" is convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. Additionally, such shortcuts may confound automated translation tools that patrons of the Ranch may be making use of.

I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.

Please read this for more information.

thanks,
bear
JavaRanch Sheriff
 
Janakiram Gattupalli
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletContext can be thought as Gloabal parameters for a web-application.Using ServletContext we can get hold of Web application's details.There is only one servletContext for a web application.
ServletConfig is local to each Servlet.Using ServletConfig we can get the reference of ServletContext,name of the servlet,etc.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic