JSP and Servlet Web Development

Covers JSP scripting elements, life cycle, implicit objects, servlet HTTP methods, HTML forms, MVC architecture, and server-side validation in web applications

11 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

In which file will the server side validations will be handled

  1. Page Handler
  2. Action Controller
  3. JSP
  4. Javascript
Question 2 Multiple Choice (Single Answer)

Where will the Life Host region of the server be mentioned

  1. ec_debug.jsp->Configuration->DomainData->LifeHost
  2. ec_debug.jsp->DomainData->Host.xml
  3. using wasops
  4. ec_debug->Jars->Registered Components->DomainData->Host
Question 3 Multiple Choice (Single Answer)

What is output to the web page on the second access to the same instance of the following JSP? (Choose one.) <%@ page language="java" %> Chapter 6 Question 2

Chapter 6 Question 2

<%! int x = 0; %> <%! public void jspInit() { System.out.println(x++); } %> <%= x++ %> <% System.out.println(x); %> <% jspInit(); %>

  1. 0
  2. 1
  3. 2
  4. 3
  5. 4
  6. Page does not translate.
Question 4 Multiple Choice (Single Answer)

Which architecture does PS framework follow

  1. Hibernate Architecture
  2. Struts Architecture
  3. MVC Architecture
  4. Web Architecture
Question 5 Multiple Choice (Multiple Answers)

Which of the following are true statements about the JavaServer Page life cycle? (Choose two.)

  1. The _jspService() method is called from the generated servlet's service() method.
  2. jspInit() is only ever called on the first request to a JSP instance.
  3. jspDestroy() is only ever called on the last request to a JSP instance.
  4. All servlet methods are accessible from the jspInit() method.
  5. You cannot override or provide a no-parameter init() method in a JSP page.
Question 6 Multiple Choice (Multiple Answers)

Which of the following techniques is likely to return an initialization parameter for a JSP page? (Choose two.)

  1. <%= request.getParameter("myParm") %>
  2. <% String s = getInitParameter("myParm"); %>
  3. <% = application.getInitParameter("myParm") %>
  4. <%= config.getInitParameter("myParm"); %>
  5. <%= getParameter("myParm") %>
Question 7 Multiple Choice (Multiple Answers)

What will be the result of pressing the submit button in the following HTML form? (Choose two.)

  1. A request is sent with the HTTP method HEAD.
  2. A request is sent with the HTTP method POST.
  3. A request is sent with the HTTP method GET.
  4. The parameter fullName is the only parameter passed to the web server in the request URL.
  5. The parameters fullName and sbmButton are passed to the web server in the request URL.
  6. The parameter fullName is the only parameter passed to the web server as part of the request body.
Question 8 Multiple Choice (Multiple Answers)

Which of the following are valid servlet methods that match up with HTTP methods? (Choose four.)

  1. doGet()
  2. doPost()
  3. doConnect()
  4. doOptions()
  5. doHead()
  6. doRequest()
Question 9 Multiple Choice (Single Answer)

What are JSP scripting elements ?

  1. declarations
  2. scriptlets
  3. expressions
  4. All of the above
Question 10 Multiple Choice (Single Answer)

How many implicit objects in jsp?

  1. 4
  2. 7
  3. 9
  4. 8
Question 11 Multiple Choice (Single Answer)

What are the kinds of comments in JSP?

  1. <%– JSP Comment –%>
  2. <!– HTML Comment –>
  3. Both a and b
  4. None of the above