Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

PRJ301 Questions and Answers 2024

Beoordeling
-
Verkocht
-
Pagina's
125
Cijfer
A+
Geüpload op
11-08-2024
Geschreven in
2024/2025

PRJ301 Questions and Answers 2024

Instelling
Vak

Voorbeeld van de inhoud

PRJ301 Questions and Answers 2024

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
** Answ** 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" ** Answ** 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 ** Answ** 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() ** Answ** 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); ** Answ** 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 ** Answ** 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 ** Answ** 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"/> ** Answ** 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 ** Answ** 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 ** Answ** 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; %> ** Answ** 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 ** Answ** 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 ** Answ** 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 %>

Which statement when placed at the location XXX can be used to compute the sum.
Select the one correct statement Select one:

a. = sum = sum + j;
b. sum = sum + j
c. = sum = sum + j
d. sum = sum + j; ** Answ** d

Which of the following statements about the Servlet is false? Select one:

a. Servlets are portable
b. Initialization code in servlets is executed every time the program is made to run
c. None of the others

, d. Servlets are easy to use ** Answ** b

A JSP page needs to perform some operations before servicing the first request. Where
can this be done? Select one:

a. within the page directive of the JSP page
b. within a method called jspInit
c. within a scriptlet at the top of the JSP page
d. within the XML element ** Answ** b

In a JSP life cycle, which of the following phases produces a Java Servlet (with
extension *.java) file? Select one:

a. None of the others
b. Initialization
c. Instantiation
d. Compilation
e. Translation ** Answ** e

Given a JSP error page, which implicit object refers to the uncaught Throwable that
resulted in the page being invoked? Select one:

a. request.exception
b. error
c. throwable
d. None of the others
e. exception ** Answ** e

A JSP page needs to generate an XML file. Which attribute of page directive may be
used to specify that the JSP page is generating an XML file? Select one:

a. <%@page contentType ="text/html">
b. None of the others
c. <%@page contentType ="html/xml">
d. <%@page contentType ="xml">
e. <%@page contentType ="text/xml"> ** Answ** e

Which of the following request dispatching techniques can be used to include the
content of another servlet into the current output stream? Select one:

a. include
b. forward
c. None of the others.
d. redirect ** Answ** a

Consider the description:

Geschreven voor

Vak

Documentinformatie

Geüpload op
11 augustus 2024
Aantal pagina's
125
Geschreven in
2024/2025
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

$12.99
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
smartchoices Chamberlain College Of Nursing
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
36
Lid sinds
5 jaar
Aantal volgers
5
Documenten
4499
Laatst verkocht
1 maand geleden

4.8

9 beoordelingen

5
7
4
2
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen