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

A can do a piece of work in 30 days, which B can do in 20 days. Both started the work but A left 5 days before the completion of the work. It took how many days to complete the work?

1 Answers   Essar,


M, N, O are jogging in the same direction around a circular track. The track is marked with numbers from 1 to 12, like the dial of a watch. The 12 numbers are uniformly spaced on the track. M overtakes N once at 5 and then the next time again at 9. M overtakes O once at 2 and then the next time again at 4. Find the ratio of N's speed to O's speed?

1 Answers   Cap Gemini,


Bulu writes the series 9, 14, 19, … , 194 on a paper and Gullu writes the series 11, 14, 17, … , 197 on anther piece of paper. Then they both compare their lists. How many numbers do both have in common?

2 Answers   TCS,


c and f are moved to the new office,how many combinations are possible? a)abc;bde b)abd;abe c)ade;abc d)bde;acd

1 Answers   dwise,


hai am Deepak here i have my exam on 3rd jan 2010 for the post of officers job in karnataka bank so kindly plz send me model papers . thank u

0 Answers   Consultancy, Indian Overseas Bank,


The LCM of two numbers is 24. The GCF is 4. One number is 4 more than the other. What are the numbers.

6 Answers  


15 tennis players take part in a tournament. Every player plays twice with each of his opponents. How many games are to be played?

1 Answers   HCL, Infosys,


A trip takes 6 hours to complete. After traveling 1/4 of an hour, 1 3/8hours, and 2 1/3 hours, how much time does need to complete the trip? There are 30 socks in a drawer. 60% of the socks are red and the rest are blue. What is the minimum number of socks that must be taken from the drawer without looking in order to be certain that atleast two blue socks have been chosen?

1 Answers   Wipro,


pls send me the aptitude question/previous years question papers of sbi to my email akhilagopakumar@yahoo.com

0 Answers   State Bank Of India SBI,


If the ticket sales s for a company increases 25% from standard sales to 60 tickets sold, then 60 - s =:

6 Answers  


If on an item a shop gives 25% discount, they earn 25% profit. If they now give 10% discount then what is the profit percentage.

10 Answers  


In certain code 'OPERATION' is written as 'POREAITNO'How is DREAMLAND written in that code.

4 Answers   Infosys,


Categories