Java Servlet Interview Questions and Answers for Experienced Pdf - 2
Question: 6
What is the role of JSP in MVC model?
JSP is mostly to develop the user interface. It plays the role of view in the MVC model.
Question: 7
Differentiate between doGet and doPost method?
doGet is used when there is a requirement of sending data appended to a query string in the URL. The doGet models the GET method of Http and it is used to retrieve the info on the client from some server as a request to it. The doGet cannot be used to send too much info appended as a query stream. GET puts the form values into the URL string. GET is limited to about 256 characters (Usually a browser limitation) and creates really ugly URLs.
Post allows you to have extremely dense forms and pass that to the server without cluster or limitation in size. E.g. you obviously can’t send a file from the client to the server via GET. POST has no limit on the amount of data you can send and because the data does not show up on the URL you can send passwords. But this does not mean that POST is truly secure. For real security you have to look into encryption which is an entirely different topic.
Question: 8
What are the methods of HttpServlet?
The methods of HttpServlet class are
doGet() is used to handle the GET, conditional GET, and HEAD requests
doPost() is used to handle POST requests
doPut() is used to handle PUT requests
doDelete() is used to handle DELETE requests
doOptions() is used to handle the OPTIONS requests and
doTrace() is used to handle the TRACE requests.
Question: 9
What do you understand by JSP Actions?
JSP actions are XML tags that direct the server to use existing components or control the behavior of the JSP engine. JSP Actions consist of a typical (XML based) prefix of “jsp” followed by a colon, followed by the action name followed by one or more attribute parameters.
There are six JSP Actions
<jsp:include/>
<jsp:forward/>
<jsp:plugin>
<jsp:usebean/>
<jsp:setProperty/>
<jsp:getProperty/>
Question: 10
What are JSP Output Comments?
JSP Output Comments are the comments that can be viewed in the HTML source file.
<!- This file displays the user login screen ->
and
<!- This page was loaded on
<%= (new java.util.Date() ). toLocaleString () %> ->
- Java Servlets and JSP Interview Questions and Answers
- Java Servlet Interview Questions for Freshers Pdf
- Java Servlet Interview Questions and Answers for Experienced Pdf
- Top 150+ Java Servlet Interview Questions and Answers
- Java Concurrency Interview Questions and Answers
- Advanced Java Interview Questions and Answers
- Tricky Servlet Interview Questions and Answers
- 150+ Advanced Java Servlet API Interview Questions 2020-2021
Signals and Systems Quiz Questions and Answers Pdf More
Signals and Systems MCQ Questions and Answers Pdf More
Electrical Power Sources Quiz Questions & Answers Pdf More
Electromagnetic Field Theory Question Bank 2024-2025 More
Power Semiconductor Device and Integrated Circuits Questions More
General Knowledge Mock Test 2020-2021 More
7000+ Chemical Engineering Aptitude Test Questions Pdf More
7000+ English Grammar Practice Set Pdf More
PG TRB Physics Study Materials 2020 - 2021 More
Active & Passive Voice Questions Answers for Class 6,7,8,9,10 More