Chapter 1. Intro and Overview: Why use Servlets & JSPs? Flashcards
1
Q
What is a CGI program?
A
Non-java term for a web server helper app. Stands for Common Gateway Interface.
2
Q
What’s the equivalent to CGI in a Java application?
A
Servlet.
3
Q
What is the web.xml called? What is it used for?
A
Deployment Descriptor
Used to declare our servlets, as well as setting a URL pattern to a servlet.
4
Q
Where does the Deployment Descriptor file go?
A
WEB-INF folder
5
Q
What base class do you extend to make a Servlet class?
A
HttpServlet
6
Q
Suppose you wanted to create a method on your servlet that handles post requests, what would that method look like?
A
Void return type, accepts HttpServletRequest & HttpServletResponse.