Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what will be the output

 
sigamala viswanath
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have one doubt such as :

some servlet calls JSP and in JSP will initialize a servlet below way
Servlet1 s=new Servlet1();
s.doPost(request,response);
and this in turn calls a jsp and this JSP calls another Servlet.

what will be the output?

Thanks,
Viswanath S
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Firstly you shouldn't instantiate your own Servlets, that should only be done by the container. As long as something eventually provides output to the client it will work fine, except if it causes an infinite loop or any of the container methods on Servlet1 are called.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic