Question 1
A JSP expression can contain any Java expression that evaluates to a
Question 1 options:
- String object
- Java object
- primitive type
- primitive type or Java object
Question 2
Which of the following JSP expressions is valid?
Question 2 options:
- <%= request.getParameter("occupation"); %>
- <%= request.getParameter("occupation") %>
- <%= String occupation = request.getParameter("occupation"); %>
- <%= String occupation = request.getParameter("occupation") %>
- None of the above
Question 3
The following code
<%
String[] mailTypes = request.getParameterValues("mail");
%>
Question 3 options:
- returns the name of all request parameters from the mail.jsp page
- returns the first value of the mail parameter or null if none exist
- returns all values of the mail parameter or null if none exist
- returns the values of all request parameters from the mail.jsp page is invalid
Question 4
In general, you should use the Post method instead of the Get method when
Question 4 options:
- the request writes data to the server
- the request reads data from the server
- you want users to be able to include parameters in their bookmarks
- when you're transferring 4 KB or less of data
Question 5
To use your own Java class in a JSP, you can import the class with a
Question 5 options:
- JSP scriptlet
- JSP expression
- JSP directive
- JSP declaration
Question 6
Which of the following is a valid JSP comment?
Question 6 options:
- // comment
- <%-- comment --%>
Question 7
In the code that follows, the numOfErrors variable
<%! int numOfErrors = 1; %>
Question 7 options:
- is initialized each time the page is requested
- is an instance variable that is not thread-safe
- is ignored by the JSP engine
- is invalid JSP code
Question 8
When a JSP is requested for the first time, the JSP engine does all but one of the following. Which one is it?
Question 8 options:
- generates a servlet for the JSP
- generates the HTML code for the JSP
- creates one instance of the servlet class
- creates one thread
Question 9
When a JSP is requested for the second time, the JSP engine
Question 9 options:
- creates a thread that has its own copy of the instance variables
- creates a thread that has its own copy of the local variables
- creates an instance of the JSP that has its own copy of the instance variables
- creates an instance of the JSP that has its own copy of the local variables
Question 10
A scriptlet contains one or __________ statements.
Question 10 options:
Question 11
To access information about the parameters that are sent to a JSP, you can use the methods of the ___________ object.
Question 11 options:
- database
- responsse
- request
- JSP
Question 12
You can use getRealPath method of a/an ____________ object to get the absolute path to a file that's part of a web application.
Question 12 options:
- ServletContext
- input
- container
- explicit
Question 13
To ensure that parameter values aren't displayed in the URL when a JSP is requested, you should use the _____________ method in the Form tag.
Question 13 options:
Question 14
If you use instance variables in a JSP, two or more _______________ may conflict when they try to read, modify, or update the same instance variable at the same time.
Question 14 options:
- users
- servers
- applications
- threads
Question 15
If you attempt to run a JSP that contains a coding error, the ____________ will display an error page.
Question 15 options:
- user
- JSP engine
- JVM
- servlet
Question 16
The ___________ attribute in an HTML form tag may specify the JSP url for a user request.
Question 16 options:
Question 17
Text fields inside an HTML form may become ______________ for a JSP when the form is submitted
Question 17 options:
- directives
- outputs
- parameters
- styles
Question 18
JSP expressions are used to display __________.
Question 18 options:
- text
- objects
- access codes
- numerical values only
Question 19
If you pass parameters in a JSP request that total more than 4KB, then you must use a ____________ method.
Question 19 options:
Question 20
If you use an HTML "A" tag to call a JSP, the ____________ method is always used.
Question 20 options: