Chapter 5 What are two steps in creating a servlet? Name two classes that a serv
ID: 3888078 • Letter: C
Question
Chapter 5
What are two steps in creating a servlet?
Name two classes that a servlet can extend. Serializable and Externalizable.
You can use methods of the ………. object to get incoming data
You can use methods of the ………. object to set outgoing data
request is an object of the class ………….
response is an object of the class………...
What kinds of exceptions a servlet can throw?
What do we need to do to be able to request a servlet?
How can we map a servlet to a URL (there are two ways)?.
What is the advantage of using web.xml to map a servlet to a URL?
What are three ways that you can request a servlet?
How can you append a parameter to a URL?
Which HTTP method does a browser use to send parameter via a URL to the server?
Which HTTP method does anchor tag use to send parameter to the server?
When should we use the HTTP GET method and when should we use HTTP POST method?
What are differences between POST and GET methods?
What is the difference between forwarding a request and redirecting?
What does data validation mean?
We can use JavaScript to validate data on …………. side ( client? Or server?)
Explain the lifecycle of a servlet.
What is the first method that is called for the first time when the servlet engine creates the instance of a servlet?
Why it is not recommended to use instance variables in servlets?
Explanation / Answer
1.
There are three approaches to make the servlet.
By executing the Servlet interface
By acquiring the GenericServlet class
By acquiring the HttpServlet class
The HttpServlet class is generally used to make the servlet on the grounds that it gives techniques to deal with http demands, for example, doGet(), doPost, doHead() and so on.
2.
GenericServlet class:
GenericServlet class executes Servlet, ServletConfig and Serializable interfaces.It gives the usage of the considerable number of techniques for these interfaces aside from the administration strategy.
The HttpServlet class:
The HttpServlet class broadens the GenericServlet class and executes Serializable interface.It gives http particular techniques, for example, doGet, doPost, doHead, doTrace and so forth.
Serialization
:
Serialization in java is an instrument of composing the condition of a question into a byte stream.It is for the most part utilized as a part of Hibernate, RMI, JPA, EJB and JMS advancements.
The invert operation of serialization is called deserialization.
Favorable position of Java Serialization
It is for the most part used to travel question's state on the system (known as marshaling).
Externalizable:
As name recommend it is externalilizing your serialization.If you need to redo your serialization system then you can utilize it.It utilizes custom composed component to perform marshaling and unmarshalling of objects.Externalizable interface broadens Serializable interface.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.