Difference between JSP & servlets.



Difference between JSP & servlets...

Answer / sivasubramanian.k

JSP are simply the html pages with some Java code
encapsulated in special tags. We use them in that case when
a smaller part of page is generated dynamicly.

Servlets on the other hand, are pure Java classes extendend
from javax.servlet.http.HttpServlet. They can generate html
pages too.

JSPs are subclasses of Servlets. They do thing the other
way with the HTML or presentation code being written and
the code being placed between special tags <% %>. The first
time a page is requested, the JSP compiler creates java
code, compiles it, registers the servlet and calls it.
After the first request, each additional request calls it
like any other servlet.

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More General Aptitude Interview Questions

complete the series: a c f j o __

1 Answers   Wipro,


You are driving along in your car on a wild, stormy night, it's raining heavily, when suddenly you pass by a bus stop, and you see three people waiting for a bus: An old lady who looks as if she is about to die. An old friend who once saved your life. The perfect partner you have been dreaming about. Which one would you choose to offer a ride to, knowing very well that there could only be one passenger in your car? This is a moral/ethical dilemma that was once actually used as part of a job application. * You could pick up the old lady, because she is going to die, and thus you should save her first; * or you could take the old friend because he once saved your life, and this would be the perfect chance to ! pay him back. * However, you may never be able to find your perfect mate again.

14 Answers   Syntensia, TCS,


A car is filled with four and half gallons of oil for full round trip. fuel is taken 1/4 gallons mor3 in going than coming. what is the fiel consumed in coming up?

0 Answers   Accenture,


starting from 2 upto how many numbers we need to check whether 907 is prime or not?

0 Answers   Cisco,


If a and b are positive integers and (a-b)/3.5 = 4/7, then the relation between a and b is

0 Answers   Cisco,






What will be the next great improvement in search technology?

3 Answers   Google,


man walks east & from turns to right & from to left &then 45degrees to right.in which direction he went

9 Answers   Cognizant, Patni,


Rajdhani Express starts from Delhi at 12:00 pm and reaches Chandigarh at 2:30 pm and Doronto Express starts from Chandigarh at 12:15 and reach at Delhi at 2:15 . What will be the time when both the trains will cross each other?

0 Answers   Cap Gemini,


can anybody solve this series 0,6,24,60,120,210,?,? please give answer with the solution

13 Answers   OpenMat,


In a certain code ‘ORGANISE’ is written as ‘BHSPDRHM’. How is ‘DESTINED’ written in that code ?

6 Answers   Bank Of India,


on an item a company gave 25% discount then they get 25% profit if it gives 10% discount then what is the profit.

0 Answers   IIT Delhi,


salary is 's' per month,'x'% of salary is given as bonus, if 3 months salary is s1,s2 & s3 then what is his salary.

3 Answers   Wipro,


Categories