What are the ADVANTAGES of SERVLETS over JSP?(NOTE : not advantages of JSP over SERVLETS)

Questions by vmshenoy   answers by vmshenoy

Showing Answers 1 - 4 of 4 Answers

Vikas Singh

  • Jan 9th, 2007
 

1. Servlets are faster than JSP.

2. We can eliminate unnecessarily code by using Servlets.

  Was this answer useful?  Yes

hi  vikas

        This ws a question which was asked to me in an interview.I didnot knew abt the second pt, but i told the first one.i.e  servlets are faster than jsp.
I told the reason too that .jsp files are to be converted into .java( JSP  life cycle).But then interviewer told that (and rightly so)that should l occur only once, since once .class file is formed then both JSP and servlets are equally faster?
Is there any other reason y servlets are faster

Also plz explain the sec point!

bye

  Was this answer useful?  Yes

Vikas Singh

  • Jan 10th, 2007
 

Hi vmshenoy,

Sevlets are slighty faster than JSP...

Ultiamtily a "JSP" will be converted as a sevlets by the "JSPC".

A JSP Compiler(JSPC) uses a set of rule for genrating the servlet code, so the JSPC adds some amount of additional code to the servlet  which may not be required in some cases. If a servlet is developed manualy, the developer knows what is required and not required, so the developer eliminate code that is not required.This is the ression why a servlet develope manualy perform slightly better than servlet genrated by "JSPC".

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions