Worksheetsjsp e servlets
Total questions: 40
Worksheet time: 21mins
Which one is the correct order of phases in JSP life cycle?
Initialization, Cleanup, Compilation, Execution
Initialization, Compilation, Cleanup, Execution
Compilation, Initialization, Execution, Cleanup
Cleanup, Compilation, Initialization, Execution
Identify the decreasing order of scopes in jsp.
session, application, page, request
application, session, response, page
application, session, request, page
session, application, request, page
Which attribute specifies a JSP page that should process any exceptions thrown but not caught in the current page?
The ErrorPage Attribute
The IsErrorPage Attribute
autoflush
isThreadSafe
Java code is embedded under which tag in JSP?
Declaration
Scriptlet
Expression
Comment
Which of the following are the valid scopes in JSP?
request, page, session, application
request, page, session, global
response, page, session, application
request, page, context, application
Choose an incorrect statement from the following.
JSP pages are easier to maintain than a servlet.
The Web Container translate a Servlet into JSP page.
JSP is built on Java Technology so it is platform independent.
A JSP page seperates presentation and business logic.
Which of the following is syntax of Declaration Tag?
<@ Declaration @>
<% Declaration %>
<& Declaration &>
<%! Declaration %>
Which is an example of the syntax used to import a class to JSP?
<% page import="java.util.List" %>
<%@ page import="java.util.List" @%>
<% import="java.util.List" %>
<%@ page import="java.util.List" %>
Which of the following is syntax of Expression Tag?
<% Expression %>
<%= Expression %>
<& Expression &>
<%! Expression %>
Choose the correct syntax of include directive?
<%@ include page="file.jsp" %>
<% include file="file.jsp" %>
<%@ include file="file.jsp" %>
<%! include page="file.jsp" %>
Quale frase riguardo Tomcat è corretta?
E' un ambiente di sviluppo per applicazioni web
Ha bisogno di IntelliJ per essere utilizzato
E' un web container e gestisce solo pagine statiche
E' in grado di eseguire servlets
Indicare la frase corretta riguardo IntelliJ e lo sviluppo Web
E' indispensabile per lo sviluppo web
Permette di sviluppare applicazioni web ed eseguirle tramite una virtualizzazione di Tomcat
Ha bisogno solo delle librerie fornite con Java per compilare ed eseguire servlet
La gerarchia delle cartelle che contengono i files di un'applicazione web in IntelliJ è identica a quella che si ritrova in Tomcat/webapp
Cosa è servlet_api.jar
E' una libreria Java per la compilazione/esecuzione di servlet
E' una libreria distribuita con il jdk/jre di Java
E' una libreria Java distribuita con Tomcat ed è identica per ciascuna distribuzione di Tomcat
E' una libreria Java distribuita con IntelliJ
Choose the correct HTML element for the largest heading:
<h6>
<heading>
<h1>
<head>
Non capisco la domanda per via dell'Inglese
What is the function of the <p> tag?
Defines a paragraph.
Makes the text purple.
It pushes the text to the right.
Prints the webpage.
Non capisco la domanda per via dell'Inglese
Name an element which doesn't have a closing tag.
<img>
<head>
<body>
<p>
Non capisco la domanda per via dell'Inglese
The content of the web (such as your pictures, text, links) will show up here.
Head
Body
Style
Folder
Non capisco la domanda per via dell'Inglese
The following tag will show a bulleted list
<ul>
<ol>
<li>
<list>
Non capisco la domanda per via dell'Inglese
Which line of HTML code creates a scrolling text box that can display three rows of text that are each 30 characters long?
<input type="textarea" name="comments" width="30" rows="3"/>
<input type="text" name="comments" chars="30" rows="3"/>
<text name="comments" width="30" rows="3">
<textarea name="comments" cols="30" rows="3">
Non capisco la domanda per via dell'Inglese
Which attribute of the <form> element is used to specify the way that user-entered Web form data will be sent to the Web server?
The get attribute
The post attribute
The method attribute
The action attribute
Non capisco la domanda per via dell'Inglese
The ___________ element defines a drop-down list
value>
<input>
<select>
<form>
Non capisco la domanda per via dell'Inglese
Dato il form in figura, quale sarà la prima linea del messaggio di request dopo il submit?
GET /action_page?firstname=Mickey&lastname=Mouse HTTP/1.1
POST /action_page?firstname=Mickey&lastname=Mouse HTTP/1.1
GET firstname=Mickey&lastname=Mouse HTTP/1.1
POST /action_page?firstname=Mickey&lastname=Mouse
Dove si trova e cosa indica la stringa "HTTP/1.1 404 Not Found"
E' la seconda linea di un messaggio di richiesta ed indica che non trova il protocollo
E' la prima linea di un messaggio di risposta HTTP ed indica che la risorsa richiesta non è sul server
E' la prima linea di un messaggio di richiesta HTTP ed indica che la risorsa richiesta non è sul server
E' la seconda linea di un messaggio di risposta HTTP ed indica che la risorsa richiesta non è sul server
Cosa NON è Tomcat?
Web container
Servlet container
Web server
HTTP server
Nessuna delle altre opzioni
Indicare quale delle seguenti frasi su MVC è FALSA
In MVC, il Controller è implementato da servlet e non può scrivere direttamente l'output nella response
In MVC, la View è implementata da JSP e può occuparsi solo di creare la presentazione dei risultati
In MVC, il Model è implementato con classi Java e si occupa di risolvere il problema in atto con eventuale gestione dei dati da un repository
In MVC, il Controller invia i dati ad una jsp tramite un'operazione di dispatch, inserendo i Javabeans creati dal Model nella request
Nessuna delle altre opzioni
Cosa restituisce il metodo getHeaderNames()
La lista dei nomi degli headers di un messaggio di richiesta
La lista dei valori degli headers di un messaggio di richiesta
La lista dei nomi e dei valori degli headers di un messaggio di richiesta
La lista dei nomi e dei valori degli headers di un messaggio di risposta
Una servlet deve estendere..
la classe HTTPServlet
la classe HTTPServletRequest
la classe HTTPServletResponse
la classe GenericServlet
Quale metodo NON fa parte della gestione della vita di una servlet?
doGet()
doPost()
close()
init()
destroy()
In JSP page directive which attribute defines the MIME(Multipurpose Internet Mail Extension) type of the HTTP response?
import
contentType
extends
info
Never end an expression with semicolon inside Expression Tag?
True
False
Which implicit object of JSP is equivalent to this variable of Java programming language?
page
pageContext
config
application
Which implicit object is only available to a JSP page which is designated as error pages?
application
Throwable
runnable
exception
_________ is responsible for managing execution of servlet
Web Container
Servlet Context
JVM
Server
Which method is called only once in Servlet life cycle ?
service()
initialize()
init()
all of the above
Which of these classes define the getWriter() method that returns an object of type PrintWriter ? Select the one correct answer. ?
HttpServletRequest
HttpServletResponse
ServletConfig
ServletContext
When the Web Container initializes a servlet, it creates a ___________ object for the servlet ?
ServletConfig
ServletInit
ServletContext
None of the above
If the client has disabled cookie in the browser, which session management mechanism could the web container employ ?
Session Management using Cookies
Session Management using URL rewriting
Either Cookies or URL rewriting
Cookies and URL rewriting must be used together
Cookies are stored on _______ side.
Client
Server
database
none
Which method is used to delete a session?
invalidateSession()
invalidate()
deleteSession()
delete()
