• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 4 out of 186 pages
Exam (elaborations)

PRJ301 Complete Answers

Document preview thumbnail
Preview 4 out of 186 pages

PRJ301 Complete Answers Entity bean is _______ Select one: a. a persistent data component b. a database object c. an object-relational mapping d. an application logic component ️a Identify the correct order of phases in the Public/Private Key encryption? 1. Server provides its public key 2. Client makes request for secure resource 3. Server provides secure resource, encrypted with the client's public key 4. Client provides its public key, encrypted with the server's public key Select one: a. 2 - 4 - 3 - 1 b. 3 - 1 - 4 - 2 c. 1 - 2 - 3 - 4 d. 2 - 1 - 4 - 3 ️d When using Form Based Authentication, which pair of fields must be used in the login form? Select one: a. j_username and j_password b. j_login and j_password c. j_user and j_password d. j_id and j_password ️a In a JSP-centric web application, you need to create a catalog browsing JSP page. The catalog is stored as a List object in the catalog attribute of the webapp's ServletContext object. Which scriptlet code snippet gives you access to the catalog object? Select one: a. % List catalog = Attribute( "catalog"); % b. % List catalog = servletCAttribute( "catalog"); % c. % List catalog = Attribute( "catalog"); %

Content preview

PRJ301 All Answers Correct

Given the HTTP message fragment: HTTP/1.1 500 Internal Server Errors Choose the correct statement
Select one:

a. The fragment message describes the request line of HTTP response message

b. None of the others

c. The fragment message describes the status line of HTTP response message

d. The fragment message describes the status line of HTTP request message

e. The fragment message describes the header information of HTTP response message ✔️c



A JSP page called test.jsp is passed a parameter name in the URL using
http://localhost/Final/test.jsp?name=John. The test.jsp contains the following code. <% String
myName=request.getParameter("name");%> <% String test= "Welcome " + myName; %> <%=test%>
What is the output? Select one:

a. The program gives a syntax error because of the statement <%=test%>

b. The program gives a syntax error because of the statement <% String
myName=request.getParameter("name");%>

c. The program gives a syntax error because of the statement <% String test= "Welcome " + myName;
%>

d. None of the others.

e. The page display "Welcome John" ✔️e



Which scripting element lets you define methods or fields that get inserted into the main body of the
servlet class (outside of the _jspService method that is called by service to process the request)? Select
one:

a. expression

b. scriptlet

c. None of the others

d. declaration e. comment ✔️d



Which method returns the actual length of the request sent by the client? Select one:

,a. getContentLength()

b. None of the others

c. getParameter()

d. getServerName()

e. getAttribute() ✔️a



Which of the followings is a correct syntax of the method that is used to get the initialized parameter in
ServletContext or ServletConfig? Select one:

a. String getInitializedParameter(String name);

b. String getInitParameter(String name);

c. All of the others.

d. String getContextParameter(String name); ✔️b



To send text outptut in a response, the following method of HttpServletResponse may be used to get
the appropriate Writer/Stream object. Select one or more:

a. getOutputStream

b. getBinaryStream

c. getStream

d. getWriter ✔️a,d



Which of the following statements about Web Container is true? Select one:



a. Container is a program, which manages the execution of servlets

b. A Web application is accessible to all users connected to the Web

c. The performance of a servlet is independent of the efficiency of the container

d. The Web Container takes request from a servlet and passes it to a Web Server for processing

e. None of the others ✔️a



Which of the following represents the XML equivalent of this statement <%@ include file="a.jsp"%> .

,Select one correct statement.

Select one:



a. <jsp:include page="a.jsp"/>

b. There is no XML equivalent of include directive.

c. <jsp:directive.include file="a.jsp"/>

d. None of the others

e. <jsp:include file="a.jsp"/> ✔️c



Which of the following attributes of the Page directive is used to specify the page to display errors which
may occur in the JSP page? Select one:



a. excption

b. isErrorPage

c. Error

d. None of the others

e. errorPage ✔️e



Name the implicit variable available to JSP pages that may be used to access all the other implicit
objects. Select one:



a. pageContext

b. request

c. response

d. page

e. out ✔️a



Which of the following statement is an expression in scripting element? Select one:

, a. <%= for(int i=0; i<n; i++) {out.println(i)} %>

b. <%= x + y - 8 %>

c. All of the others

d. <%= x + y; %> ✔️b



Given a JSP code fragment <% int a = Integer.parseInt("a"); %> Choose the correct statement Select one:



a. The code is generated in jspInit method by JSP enginer

b. None of the others

c. The code is generated in _jspService method by JSP engine

d. The code is generated besides of _jspService method by JSP engine ✔️c



Which of the following statements about Request and Response message structure is false? Select one:



a. Request message structure consists of request line and header information

b. Request line returns the User-Agent along with the Accept header

c. Header information in response message contains information such as server, last modified date,
content-length and content type

d. None of the others ✔️b



Assume that you need to write a JSP page that adds numbers from one to ten, and then print the
output.



<% int sum = 0;

for(j = 0; j < 10; j++) { %>

<% // XXX --- Add j to sum %>

<% } %>

<% // YYY --- Display ths sum %>

Document information

Uploaded on
October 1, 2024
Number of pages
186
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$10.39

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
CertifiedGrades
3.9
(38)
Sold
149
Followers
61
Items
8729
Last sold
1 month ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions