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

23*2

1 Answers  


Four concentric circles are given. The radius of 1st circle is x. Next is 2x, then 3x and 4x. Given that area between 2nd and 1st is A and 4th and 3rd circles being B. Find ratio of A to B

0 Answers   Cisco,


Last year Jose sold a painting for $2000. If he made a 25% profit on the sale, how much had he paid for the painting?

6 Answers   eClerx, PPL,


the credit for integrating the Indian princely states goes to

1 Answers  


If substitution is as it's burnout. Didn't remember. But this is one.

0 Answers   3D PLM,






Direction for Qn 9-12 Five teams participated in Pepsi Cup. Each team played against each other. The top teams played finals. A win fetched 2 pts and a tie 1 point 1) South Africa were in the finals 2) India defeated SA but failed to reach the finals 3) Australia lost only one match in the tournament 4) The match between India and Sri Lanka was a tie 5) The undefeated team in the league matches lost in the finals 6) England was one of the best teams that did not qualify 9. Who were the finalists? i. SA & India ii. Aus & SL iii. SA & SL iv. none 10. Who won the finals? i. Aus ii. SL iii. SA iv. Can't be determined 11. How many matches did India Win? i. 0 ii. 1 iii. 2 iv. can't be determined 12. What was the outcome of the India England Match i. India won ii. England won iii. It was a tie iv. Can't be determined Direction for Qn 13-14 These qns are based on situations given below: 7 Uni crick players are to be honored at a special luncheon. The players will be seated on a dais along one side of a single rectangular table. A and G have to leave the luncheon early and must be seated at the extreme right end of table, which is closest to exit. B will receive Man of the Match and must be in the centre chair C and D who are bitter rivals for the position of Wicket keeper dislike one another and should be seated as far apart as possible E and F are best friends and want to seat together. 13. Which of the foll may not be seated at either end of the table? i. C ii. D iii. G iv. F 14. Which of the foll pairs may not be seated together? i. E & A ii. B & D iii. C & F iv. G & D Direction for Qn 15-18 An employee has to allocate offices to 6 staff members. The offices are no. 1-6. the offices are arranged in a row and they are separated from each other by dividers>hence voices, sounds and cigarette smoke flow easily from one office to another Miss R needs to use the telephone quite often throughout the day. Mr. M and Mr. B need adjacent offices as they need to consult each other often while working. Miss H is a senior employee and his to be allotted the office no. 5, having the biggest window. Mr D requires silence in office next to his. Mr. T, Mr M and Mr. D are all smokers. Miss H finds tobacco smoke allergic and consecutively the offices next to hers are occupied by non-smokers. Unless specifically stated all the employees maintain an atmosphere of silence during office hrs. 15. The ideal candidate to occupy office farthest from Mr. B will be i. Miss H ii. Mr. M iii. Mr. T iv. Mr. D 16. The three employees who are smokers should be seated in the offices i. 1 2 4 ii. 2 3 6 iii. 1 2 3 iv. 1 2 3 17. The ideal office for Mr. M would be i. 2 ii. 6 iii. 1 iv. 3 18. In the event of what occurrence within a period of one month since the assignment of the offices would a request for a change in office be put forth by one or more employees? i. Mr D quitting smoking ii. Mr. T taking over duties formally taken care of by Miss R iii. The installation of a water cooler in Miss H's office iv. Mr. B suffering from anemia Direction for Qn 19-20 A robot moves on a graph sheet with x-y axes. The robot is moved by feeding it with a sequence of instructions. The different instructions that can be used in moving it, and their meanings are: Instruction Meaning GOTO(x,y) move to pt with co-ord (x,y) no matter where u are currently WALKX(P) move parallel to x-axis through a distance of p, in the +ve direction if p is +ve and in -ve if p is -ve WALKY(P) move parallel to y-axis through a distance of p, in the +ve direction if p is +ve and in -ve if p is -ve 19. The robot reaches point (5,6) when a sequence of 3 instr. Is executed, the first of which is GOTO(x,y) , WALKY(2), WALKY(4). What are the values of x and y?? i. 2,4 ii. 0,0 iii. 3,2 iv. 2,3 20. The robot is initially at (x.y), x>0 and y<0. The min no. of Instructions needed to be executed to bring it to origin (0,0) if you are prohibited from using GOTO instr. Is: i. 2 ii. 1 iii. x + y iv. 0 Direction for Qn 21-23 Ten coins are distr. Among 4 people P, Q, R, S such that one of them gets a coin, another gets 2 coins,3rd gets 3 coins, and 4th gets 4 coins. It is known that Q gets more coins than P, and S gets fewer coins than R 21. If the no. of coins distr. To Q is twice the no. distr. to P then which one of the foll. is necessarily true? i. R gets even no. of coins ii. R gets odd no. of coins iii. S gets even no. of coins iv. S gets odd no. of coins 22. If R gets at least two more coins than S which one of the foll is necessarily true? i. Q gets at least 2 more coins than S ii. Q gets more coins than P iii. P gets more coins than S iv. P and Q together get at least five coins 23. If Q gets fewer coins than R, then which one of the foll. is not necessarily true? i. P and Q together get at least 4 coins ii. Q and S together get at least 4 coins iii. R and S together get at least 5 coins iv. P and R together get at least 5 coins Direction for Qn 24-25 Elle is 3 times older than Zaheer. Zaheer is ? as old as Waheeda. Yogesh is elder than Zaheer. 24. What is sufficient to estimate Elle's age? i. Zaheer is 10 yrs old ii. Yogesh and Waheeda are both older than Zaheer by the same no of yrs. iii. Both of the above iv. None of the above 25. Which one of the foll. statements can be inferred from the info above i. Yogesh is elder than Waheeda ii. Elle is older than Waheeda iii. Elle's age may be less than that of Waheeda iv. None of the above

3 Answers   Cap Gemini, Coca Cola, TCS,


When time is 1:50, what is the angle between the two hands of a clock?

0 Answers   3i Infotech,


3x+4y=10, x3 + y3=6, What is the minimum value of 3x+11y=?

0 Answers   CTS,


A room is 30 X 12 X 12. a spider is on the middle of the smaller wall, 1 feet from the top, and a fly is on the middle of the opposite wall 1 feet from the bottom. what is the min distance required for the spider to crawl to the fly.

0 Answers  


in a market 4 man are standing .the average age of the four before 4 years is 45, after some days one man is added and his age is 49. What is the average age of all?

0 Answers   TCS,


The original fort in Bangalore was built in the 16th century. Later on, it was subject to the authority of the Marathas and then the Mughals. Who amongst them bought Bangalore in the 17th century from the Mghals for three lakhs?

3 Answers   RRB,


In a cycle race there are 5 persons named as J, K, L, M, N participated for 5 positions so that in how many number of ways can M make always before N?

0 Answers   HCL, Infosys,


Categories