Java Servlet
QUIZ
Arulkumar Varatharajan – AP/CSE
1
Quiz
2
▰1. The Java __________ specification defines an application programming
interface for communication between the Web server and the application
program.
a) Servlet
b) Server
c) Program
d) Randomize
▰Answer:a
Explanation:Servlets are commonly used to generate dynamic responses to HTTP
requests.
Quiz
3
▰2. The doGet() method in the example extracts values of the parameter’s type
and number by using __________
a) request.getParameter()
b) request.setParameter()
c) responce.getParameter()
d) responce.getAttribute()
▰Answer:a
Explanation:These methods uses these values to run a query against a database.
Quiz
4
▰3. How many JDBC driver types does Sun define?
a) One
b) Two
c) Three
d) Four
▰Answer:d
Explanation:JBDB.DriverManager.getConnection() is used to get the connection to the
database.
Quiz
5
▰4. Which JDBC driver Type(s) can be used in either applet or servlet code?
a) Both Type 1 and Type 2
b) Both Type 1 and Type 3
c) Both Type 3 and Type 4
d) Type 4 only
▰Answer:c
Explanation:In a Type 3 driver, a three-tier approach is used to accessing databases.
The JDBC clients use standard network sockets to communicate with an middleware
application server.In a Type 4 driver, a pure Java-based driver that communicates
directly with vendor’s database through socket connection.
Quiz
6
▰A JSP is transformed into a(n):
a) Java applet
b) Java servlet
c) Either 1 or 2 above
d) Neither 1 nor 2 above
▰Answer:b
Explanation:Servlets are commonly used to generate dynamic responses to HTTP
requests.
Quiz
7
▰The sendRedirect() method of HttpServletResponse interface can be used to
redirect response to another resource, it may be servlet, jsp or html file.
▰a. True
▰b. False
▰ANSWER: True
▰Explanation:
No explanation is available for this question!
Quiz
8
▰Which of these ways used to communicate from an applet to servlet?
- Published on 22 Jul 15
a. RMI Communication
▰b. HTTP Communication
▰c. Socket Communication
▰d. All mentioned above
▰ANSWER: All mentioned above
Quiz
9
▰ Sessions is a part of the SessionTracking and it is for maintaining the client state at
server side.
a. True
▰b. False
▰ANSWER: True
Quiz
10
▰Which method is used to send the same request and response objects to another servlet
in RequestDispacher ?
a. forward()
▰b. sendRedirect()
▰c. Both A & B
▰d. None of the above
▰ANSWER: forward()
Quiz
11
▰ Which object is created by the web container at time of deploying the project?
- Published on 15 Jul 15
a. ServletConfig
▰b. ServletContext
▰c. Both A & B
▰d. None of the above
▰ANSWER: ServletContext
Quiz
12
▰Which method in session tracking is used in a bit of information that is sent by a web
server to a browser and which can later be read back from that browser?
- Published on 15 Jul 15
a. HttpSession
▰b. URL rewriting
▰c. Cookies
▰d. Hidden form fields
▰ANSWER: Cookies
Quiz
13
▰jspDestroy() method of HttpJspPage class can be overridden.
▰A - True
▰B - False
▰Answer : A
▰Explaination
▰Yes, jspDestroy() method can be overridden.
Quiz
14
▰Which of the following are the valid scopes in JSP?
▰A - request, page, session, application
▰B - request, page, session, global
▰C - response, page, session, application
▰D - request, page, context, application
▰Answer : A
▰Explaination
▰The scope attribute identifies the lifecycle of the Action element. It has four possible values: (a)
page, (b) request, (c) session, and (d) application.
Quiz
15
▰Which of the following are the valid scopes in JSP?
▰A - request, page, session, application
▰B - request, page, session, global
▰C - response, page, session, application
▰D - request, page, context, application
▰Answer : A
▰Explaination
▰The scope attribute identifies the lifecycle of the Action element. It has four possible values: (a)
page, (b) request, (c) session, and (d) application.
HELLO!
I am Jayden Smith
I am here because I love to give presentations.
You can find me at @username
16
TRANSITION HEADLINE
Let’s start with the first set of slides
17
1
“Quotations are commonly printed
as a means of inspiration and to
invoke philosophical thoughts
from the reader.
1818
THIS IS A SLIDE TITLE
▰Here you have a list of items
▰And some text
▰But remember not to overload your slides
with content
Your audience will listen to you or read the
content, but won’t do both.
19
White
Is the color of milk and fresh
snow, the color produced by the
combination of all the colors of
the visible spectrum.
YOU CAN ALSO SPLIT YOUR CONTENT
Black
Is the color of coal, ebony, and
of outer space. It is the darkest
color, the result of the absence
of or complete absorption of
light.
20
IN TWO OR THREE COLUMNS
Yellow
Is the color of gold,
butter and ripe lemons.
In the spectrum of
visible light, yellow is
found between green
and orange.
Blue
Is the colour of the
clear sky and the deep
sea. It is located
between violet and
green on the optical
spectrum.
Red
Is the color of blood,
and because of this it
has historically been
associated with
sacrifice, danger and
courage.
21
A PICTURE IS WORTH A THOUSAND WORDS
A complex idea can be
conveyed with just a single
still image, namely making it
possible to absorb large
amounts of data quickly.
22
Want big impact?
USE BIG IMAGE
23
USE CHARTS TO EXPLAIN YOUR IDEAS
24
GrayWhite Black
AND TABLES TO COMPARE DATA
A B C
Yellow 10 20 7
Blue 30 15 10
Orange 5 24 16
25
MAPS
26
OUR OFFICE
89,526,124
Whoa! That’s a big number, aren’t you proud?
27
89,526,124$
That’s a lot of money
100%
Total success!
185,244 users
And a lot of users
28
OUR PROCESS IS EASY
29
first second last
LET’S REVIEW SOME CONCEPTS
Yellow
Is the color of gold, butter and ripe
lemons. In the spectrum of visible
light, yellow is found between
green and orange.
Blue
Is the colour of the clear sky and
the deep sea. It is located between
violet and green on the optical
spectrum.
Red
Is the color of blood, and because
of this it has historically been
associated with sacrifice, danger
and courage.
30
Yellow
Is the color of gold, butter and ripe
lemons. In the spectrum of visible
light, yellow is found between
green and orange.
Blue
Is the colour of the clear sky and
the deep sea. It is located between
violet and green on the optical
spectrum.
Red
Is the color of blood, and because
of this it has historically been
associated with sacrifice, danger
and courage.
ANDROID PROJECT
Show and explain your
web, app or software
projects using these
gadget templates.
Place your screenshot here
32
Place your screenshot here
33
iPHONE PROJECT
Show and explain your
web, app or software
projects using these
gadget templates.
Place your screenshot here
34
TABLET PROJECT
Show and explain your
web, app or software
projects using these
gadget templates.
Place your screenshot here
35
DESKTOP PROJECT
Show and explain your
web, app or software
projects using these
gadget templates.
36
THANKS!
Any questions?
You can find me at
@username & user@mail.me
CREDITS
Special thanks to all the people who made and
released these awesome resources for free:
▰ Presentation template by SlidesCarnival
▰ Photographs by Startup Stock Photos
37
PRESENTATION DESIGN
This presentation uses the following typographies and colors:
▰ Titles: Roboto Condensed
▰ Body copy: Roboto Condensed
You can download the fonts on this page:
https://material.io/guidelines/resources/roboto-noto-fonts.html
Navy #3f5378 · Dark navy #263248 · Yellow #ff9800
You don’t need to keep this slide in your presentation. It’s only here to serve you as a design guide if you need to create
new slides or download the fonts to edit the presentation in PowerPoint®
38
SlidesCarnival icons are editable shapes.
This means that you can:
● Resize them without losing quality.
● Change line color, width and style.
Isn’t that nice? :)
Examples:
39
Now you can use any emoji as an icon!
And of course it resizes without losing quality and you can change the color.
How? Follow Google instructions
https://twitter.com/googledocs/status/730087240156643328
✋👆👉👍👤👦👧👨👩👪💃🏃💑❤😂
😉😋😒😭👶😸🐟🍒🍔💣📌📖🔨🎃🎈
🎨🏈🏰🌏🔌🔑 and many more...
😉
40

Quiz servlet

  • 1.
  • 2.
    Quiz 2 ▰1. The Java__________ specification defines an application programming interface for communication between the Web server and the application program. a) Servlet b) Server c) Program d) Randomize ▰Answer:a Explanation:Servlets are commonly used to generate dynamic responses to HTTP requests.
  • 3.
    Quiz 3 ▰2. The doGet()method in the example extracts values of the parameter’s type and number by using __________ a) request.getParameter() b) request.setParameter() c) responce.getParameter() d) responce.getAttribute() ▰Answer:a Explanation:These methods uses these values to run a query against a database.
  • 4.
    Quiz 4 ▰3. How manyJDBC driver types does Sun define? a) One b) Two c) Three d) Four ▰Answer:d Explanation:JBDB.DriverManager.getConnection() is used to get the connection to the database.
  • 5.
    Quiz 5 ▰4. Which JDBCdriver Type(s) can be used in either applet or servlet code? a) Both Type 1 and Type 2 b) Both Type 1 and Type 3 c) Both Type 3 and Type 4 d) Type 4 only ▰Answer:c Explanation:In a Type 3 driver, a three-tier approach is used to accessing databases. The JDBC clients use standard network sockets to communicate with an middleware application server.In a Type 4 driver, a pure Java-based driver that communicates directly with vendor’s database through socket connection.
  • 6.
    Quiz 6 ▰A JSP istransformed into a(n): a) Java applet b) Java servlet c) Either 1 or 2 above d) Neither 1 nor 2 above ▰Answer:b Explanation:Servlets are commonly used to generate dynamic responses to HTTP requests.
  • 7.
    Quiz 7 ▰The sendRedirect() methodof HttpServletResponse interface can be used to redirect response to another resource, it may be servlet, jsp or html file. ▰a. True ▰b. False ▰ANSWER: True ▰Explanation: No explanation is available for this question!
  • 8.
    Quiz 8 ▰Which of theseways used to communicate from an applet to servlet? - Published on 22 Jul 15 a. RMI Communication ▰b. HTTP Communication ▰c. Socket Communication ▰d. All mentioned above ▰ANSWER: All mentioned above
  • 9.
    Quiz 9 ▰ Sessions isa part of the SessionTracking and it is for maintaining the client state at server side. a. True ▰b. False ▰ANSWER: True
  • 10.
    Quiz 10 ▰Which method isused to send the same request and response objects to another servlet in RequestDispacher ? a. forward() ▰b. sendRedirect() ▰c. Both A & B ▰d. None of the above ▰ANSWER: forward()
  • 11.
    Quiz 11 ▰ Which objectis created by the web container at time of deploying the project? - Published on 15 Jul 15 a. ServletConfig ▰b. ServletContext ▰c. Both A & B ▰d. None of the above ▰ANSWER: ServletContext
  • 12.
    Quiz 12 ▰Which method insession tracking is used in a bit of information that is sent by a web server to a browser and which can later be read back from that browser? - Published on 15 Jul 15 a. HttpSession ▰b. URL rewriting ▰c. Cookies ▰d. Hidden form fields ▰ANSWER: Cookies
  • 13.
    Quiz 13 ▰jspDestroy() method ofHttpJspPage class can be overridden. ▰A - True ▰B - False ▰Answer : A ▰Explaination ▰Yes, jspDestroy() method can be overridden.
  • 14.
    Quiz 14 ▰Which of thefollowing are the valid scopes in JSP? ▰A - request, page, session, application ▰B - request, page, session, global ▰C - response, page, session, application ▰D - request, page, context, application ▰Answer : A ▰Explaination ▰The scope attribute identifies the lifecycle of the Action element. It has four possible values: (a) page, (b) request, (c) session, and (d) application.
  • 15.
    Quiz 15 ▰Which of thefollowing are the valid scopes in JSP? ▰A - request, page, session, application ▰B - request, page, session, global ▰C - response, page, session, application ▰D - request, page, context, application ▰Answer : A ▰Explaination ▰The scope attribute identifies the lifecycle of the Action element. It has four possible values: (a) page, (b) request, (c) session, and (d) application.
  • 16.
    HELLO! I am JaydenSmith I am here because I love to give presentations. You can find me at @username 16
  • 17.
    TRANSITION HEADLINE Let’s startwith the first set of slides 17 1
  • 18.
    “Quotations are commonlyprinted as a means of inspiration and to invoke philosophical thoughts from the reader. 1818
  • 19.
    THIS IS ASLIDE TITLE ▰Here you have a list of items ▰And some text ▰But remember not to overload your slides with content Your audience will listen to you or read the content, but won’t do both. 19
  • 20.
    White Is the colorof milk and fresh snow, the color produced by the combination of all the colors of the visible spectrum. YOU CAN ALSO SPLIT YOUR CONTENT Black Is the color of coal, ebony, and of outer space. It is the darkest color, the result of the absence of or complete absorption of light. 20
  • 21.
    IN TWO ORTHREE COLUMNS Yellow Is the color of gold, butter and ripe lemons. In the spectrum of visible light, yellow is found between green and orange. Blue Is the colour of the clear sky and the deep sea. It is located between violet and green on the optical spectrum. Red Is the color of blood, and because of this it has historically been associated with sacrifice, danger and courage. 21
  • 22.
    A PICTURE ISWORTH A THOUSAND WORDS A complex idea can be conveyed with just a single still image, namely making it possible to absorb large amounts of data quickly. 22
  • 23.
  • 24.
    USE CHARTS TOEXPLAIN YOUR IDEAS 24 GrayWhite Black
  • 25.
    AND TABLES TOCOMPARE DATA A B C Yellow 10 20 7 Blue 30 15 10 Orange 5 24 16 25
  • 26.
  • 27.
    89,526,124 Whoa! That’s abig number, aren’t you proud? 27
  • 28.
    89,526,124$ That’s a lotof money 100% Total success! 185,244 users And a lot of users 28
  • 29.
    OUR PROCESS ISEASY 29 first second last
  • 30.
    LET’S REVIEW SOMECONCEPTS Yellow Is the color of gold, butter and ripe lemons. In the spectrum of visible light, yellow is found between green and orange. Blue Is the colour of the clear sky and the deep sea. It is located between violet and green on the optical spectrum. Red Is the color of blood, and because of this it has historically been associated with sacrifice, danger and courage. 30 Yellow Is the color of gold, butter and ripe lemons. In the spectrum of visible light, yellow is found between green and orange. Blue Is the colour of the clear sky and the deep sea. It is located between violet and green on the optical spectrum. Red Is the color of blood, and because of this it has historically been associated with sacrifice, danger and courage.
  • 32.
    ANDROID PROJECT Show andexplain your web, app or software projects using these gadget templates. Place your screenshot here 32
  • 33.
    Place your screenshothere 33 iPHONE PROJECT Show and explain your web, app or software projects using these gadget templates.
  • 34.
    Place your screenshothere 34 TABLET PROJECT Show and explain your web, app or software projects using these gadget templates.
  • 35.
    Place your screenshothere 35 DESKTOP PROJECT Show and explain your web, app or software projects using these gadget templates.
  • 36.
    36 THANKS! Any questions? You canfind me at @username & user@mail.me
  • 37.
    CREDITS Special thanks toall the people who made and released these awesome resources for free: ▰ Presentation template by SlidesCarnival ▰ Photographs by Startup Stock Photos 37
  • 38.
    PRESENTATION DESIGN This presentationuses the following typographies and colors: ▰ Titles: Roboto Condensed ▰ Body copy: Roboto Condensed You can download the fonts on this page: https://material.io/guidelines/resources/roboto-noto-fonts.html Navy #3f5378 · Dark navy #263248 · Yellow #ff9800 You don’t need to keep this slide in your presentation. It’s only here to serve you as a design guide if you need to create new slides or download the fonts to edit the presentation in PowerPoint® 38
  • 39.
    SlidesCarnival icons areeditable shapes. This means that you can: ● Resize them without losing quality. ● Change line color, width and style. Isn’t that nice? :) Examples: 39
  • 40.
    Now you canuse any emoji as an icon! And of course it resizes without losing quality and you can change the color. How? Follow Google instructions https://twitter.com/googledocs/status/730087240156643328 ✋👆👉👍👤👦👧👨👩👪💃🏃💑❤😂 😉😋😒😭👶😸🐟🍒🍔💣📌📖🔨🎃🎈 🎨🏈🏰🌏🔌🔑 and many more... 😉 40