- Which of the following is true about Servlets?
View Answer
Correct answer: D — All of the above
- What will be printed?
1 import javax.servlet.*; 2 import javax.servlet.http.*; 3 public class EduinqServlet extends HttpServlet { 4 protected void doGet(HttpServletRequest req, HttpServletResponse resp) { 5 System.out.println("Eduinq Servlet GET"); 6 } 7 } View Answer
Correct answer: A — Eduinq Servlet GET
- Which of the following is true about JSP?
View Answer
Correct answer: D — All of the above
- What will be printed?
1 <%@ page language="java" %> 2 <html> 3 <body> 4 <%= "Eduinq JSP" %> 5 </body> 6 </html> View Answer
Correct answer: A — Eduinq JSP
- Which of the following is true about JSP implicit objects?
View Answer
Correct answer: D — All of the above
- Which of the following is true about Filters in Servlets?
View Answer
Correct answer: D — All of the above
- What will be printed?
1 import javax.servlet.*; 2 public class EduinqFilter implements Filter { 3 public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) { 4 System.out.println("Eduinq Filter Applied"); 5 } 6 } View Answer
Correct answer: A — Eduinq Filter Applied
- Which of the following is true about Session Management?
View Answer
Correct answer: D — All of the above
- What will be printed?
1 HttpSession session = request.getSession(); 2 session.setAttribute("eduinq","Portal"); 3 System.out.println(session.getAttribute("eduinq")); View Answer
Correct answer: A — Portal
- Which of the following is true about ServletContext?
View Answer
Correct answer: D — All of the above
- Which of the following is true about RESTful Web Services?
View Answer
Correct answer: D — All of the above
- What will be printed?
1 import javax.ws.rs.*; 2 @Path("/eduinq") 3 public class EduinqRest { 4 @GET 5 @Produces("text/plain") 6 public String getMsg() { 7 return "Eduinq REST Service"; 8 } 9 } View Answer
Correct answer: A — Eduinq REST Service
- Which of the following is true about ServletConfig?
View Answer
Correct answer: D — All of the above
- Which of the following is true about JSP directives?
View Answer
Correct answer: D — All of the above
- Which of the following is true about JSP actions?
View Answer
Correct answer: D — All of the above
- Which of the following is true about MVC architecture in web apps?
View Answer
Correct answer: D — All of the above
- Which of the following is true about Servlet lifecycle?
View Answer
Correct answer: D — All of the above
- Which of the following is true about JSP lifecycle?
View Answer
Correct answer: D — All of the above
- Which of the following is true about REST design principles?
View Answer
Correct answer: D — All of the above
- Which of the following is true about Filters chaining?
View Answer
Correct answer: D — All of the above
- Which of the following is true about HttpSession invalidation?
View Answer
Correct answer: D — All of the above
- What will be printed?
1 HttpSession session = request.getSession(); 2 session.setAttribute("eduinq","Portal"); 3 session.invalidate(); 4 System.out.println(session.getAttribute("eduinq")); View Answer
Correct answer: A — null
- Which of the following is true about session timeout?
View Answer
Correct answer: D — All of the above
- Which of the following is true about JSP Expression Language (EL)?
View Answer
Correct answer: D — All of the above
- What will be printed?
1 <% 2 request.setAttribute("eduinq","Portal"); 3 %> 4 ${eduinq} View Answer
Correct answer: A — Portal
- Which of the following is true about JSTL?
View Answer
Correct answer: D — All of the above
- What will be printed?
1 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 2 <c:set var="eduinq" value="Portal"/> 3 <c:out value="${eduinq}"/> View Answer
Correct answer: A — Portal
- Which of the following is true about @PathParam in REST?
View Answer
Correct answer: D — All of the above
- What will be printed?
1 import javax.ws.rs.*; 2 @Path("/eduinq") 3 public class EduinqRest { 4 @GET 5 @Path("/{name}") 6 public String getMsg(@PathParam("name") String name) { 7 return "Eduinq " + name; 8 } 9 } View Answer
Correct answer: A — Eduinq Portal (if /eduinq/Portal called)
- Which of the following is true about @QueryParam in REST?
View Answer
Correct answer: D — All of the above
- What will be printed?
1 import javax.ws.rs.*; 2 @Path("/eduinq") 3 public class EduinqRest { 4 @GET 5 public String getMsg(@QueryParam("id") String id) { 6 return "Eduinq ID " + id; 7 } 8 } View Answer
Correct answer: A — Eduinq ID 10 (if /eduinq?id=10 called)
- Which of the following is true about JSON marshalling in REST?
View Answer
Correct answer: D — All of the above
- Which of the following is true about XML marshalling in REST?
View Answer
Correct answer: D — All of the above
- Which of the following is true about Authentication Filters?
View Answer
Correct answer: D — All of the above
- Which of the following is true about Servlet Listeners?
View Answer
Correct answer: D — All of the above
- Which of the following is true about HttpSessionListener?
View Answer
Correct answer: D — All of the above
- Which of the following is true about debugging JSP?
View Answer
Correct answer: D — All of the above
- Which of the following is true about ServletException?
View Answer
Correct answer: D — All of the above
- Which of the following is true about RequestDispatcher?
View Answer
Correct answer: D — All of the above
- What will be printed?
1 RequestDispatcher rd = request.getRequestDispatcher("eduinq.jsp"); 2 rd.include(request,response); 3 System.out.println("Eduinq Include Done"); View Answer
Correct answer: A — Eduinq Include Done
- Which of the following is true about Servlet forward vs include?
View Answer
Correct answer: D — All of the above
- Which of the following is true about JSP error handling?
View Answer
Correct answer: D — All of the above
- Which of the following is true about web.xml deployment descriptor?
View Answer
Correct answer: D — All of the above
- Which of the following is true about annotations replacing web.xml?
View Answer
Correct answer: D — All of the above
- Which of the following is true about REST response codes?
View Answer
Correct answer: D — All of the above
- Which of the following is true about REST content negotiation?
View Answer
Correct answer: D — All of the above
- Which of the following is true about Servlet security constraints?
View Answer
Correct answer: D — All of the above
- Which of the following is true about JSP EL operators?
View Answer
Correct answer: D — All of the above
- Which of the following is true about REST statelessness?
View Answer
Correct answer: D — All of the above
- Which of the following is true about REST best practices?
View Answer
Correct answer: D — All of the above