0

I was asked this question in an interview. If I include jsp A in jsp B and jsp B in jsp A (using include statements) and run the server, what will happen?

1) what kind of error/exception will you get? 2) will you get the same error/exception every time you run the server?

I tried tomcat. my system freezed and I had to kill the process, didn't wait for it to end. In the interview, I mumbled it should throw either stackoverlflow error or out of memory error and the guy asked which one? when loading jsps, does the container use space on the stack or not?

Jayz
  • 1,174
  • 2
  • 19
  • 43
  • And what happened when you tried it? Which implementations of JSP did you use? What containers were they running in? – Bob Dalgleish Jul 28 '13 at 12:45
  • updated my question with what I tried – Jayz Jul 28 '13 at 14:41
  • The short answer is, "it depends." For the particular version of Tomcat you were using, it goes into an infinite loop and does not put out an error message. Other JSP servlets will go out of memory because they use an explicit stack. You were actually being tested on you ability to not fudge an answer, unless, of course, the interviewer didn't actually know what they were talking about. – Bob Dalgleish Jul 28 '13 at 22:53

0 Answers0