• Post Reply Bookmark Topic Watch Topic
  • New Topic

check if container is there

 
maiku fuko
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I wanted to check if there was a web container and I want different behavior for each, how would I check that.
Something like - if(getContainer == false){do this}else(do that)
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If there's no container, what will be running the code?
 
Evelin Priyadarsini
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
with reference to Headfirst:
Servlets dont have main() method. they are under the control of another java application called Container.
tomcat is an example for a Container. It's the container that gives the servlet the HTTP request and response and also it calls the servlet's methods.(doGet()/doPost())
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!