1/394
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
_____ provides a way to identify a user across more than one page request or visit to a Web site and to store information about that user. Select one: a. Cookie b. Hidden Field c. Session management d. URL Rewrite -
c
Which of the following directories are legal locations for the deployment descriptor file? Note that all paths are shown as from the root of the machine or drive. Select one: a. /WEB-INF b. /WEB-INF/xml c. /WEB-INF/classes d. None of others -
a
B
C
The following line of code exists in the doGet method of Servlet: String sid = request.getParameter("jsessionid"); Which of the option is NOT a standard technique for retrieving the HttpSession associated with the request? A. HttpSession session = request.getSession(true); B. HttpSession session = request.getSession(false); C. HttpSession session = request.getSession(); D. HttpSession session = request. getSession(sid); -
D
A
The HttpServletRequest has methods by which you can find out about incoming information such as: A. form data B. the client's hostname C. cookies D. HTTP request headers E. All of the others -
E
Which of the following statement is correct? A. Authentication means determining whether one has access to a particular resource or not. B. Data Integrity means that the data cannot be viewed by anybody other than it's intended recepient. C. Data Integrity means that the data is not modified in transit between the sender and the receiver. -
C
B
... is the well-known host name that refers to your own computer. A. localhost B. ip C. DNS D. computer name -
A
Which of the following elements defines the properties of an attribute that a tag needs? A. attribute B. tag-attribute-type C. attribute-type D. tag-attribute -
A
Which interface and method should be used to retrieve a servlet initialization parameter value? A. ServletConfig: getInitParameter(String name) B. ServletConfig: getParameter(String name) C. ServletConfig: getInitParameterNames(String name) D. SevletContext: getInitParameter(String name) -
A
D
Which of the following is NOT a valid attribute for a useBean tag?
A. className B. beanName C. scope -
A
You need to make sure that the response stream of your web application is secure. Which factor will you look at?
A. authorization B. authentication C. data integrity -
C
Which is NOT a standard technique for a session be definitely invalidated?
A. The container is shutdown and brought up again. B. No request comes from the client for more than "session timeout" period. C. If the session time out is set to 0 using setMaxInactiveInterval() method. D. A servlet explicitly calls invalidate() on a session object. -
C
Which statements are BEST describe include directive of JSP file?
A. Allows programmers to include their own new tags in the form of tag libraries. These libraries can be used to encapsulate functionality and simplify the coding of a JSP. B. The scripting language used in the JSP. Currently, the only valid for this attribute is java. C. Causes the JSP container to perform a translation-time insertion of another resource's content. As the JSP is translated into a servlet and compiled, the referenced file replaces the include directive and is translated as if it were original part of the JSP. D. Defines page setting for the JSP container to process. -
C
A JSP page uses the java.util.ArrayList class many times. Instead of referring the class by its complete package name each time, we want to just use ArrayList. Which attribute of page directive must be specified to achieve this.
A. extends B. import C. include D. package E. classpath -
B
Browsers typically cache the server's response to a POST request.
A. True B. False -
B
Which security mechanism limits access to the availability of resources to permitted groups of users or programs?
A. MD5 encryption B. Authentication C. Data integrity D. Authorization E. Confidentiality F. Checksum validation -
D
The two most common HTTP requests are get and put.
A. False B. True -
A
Identify correct statement about a WAR file:
A. It is used by web application developer to deliver the web application in a single unit B. It cannot be unpackaged by the container C. It is an XML document D. It contains web components such as servlets as well as EJBs E. It cannot contain third party jar and class files. -
D
Your web application logs a user in when she supplies username/password. At that time a session is created for the user. Your want to let the user to be logged in only for 20 minutes. The application should redirect the user to the login page upon any request after 20 minutes of activity. Which of the following HttpSession methods would be helpful to you for implementing this functionality?
A. getCreationTime() B. getLastAccessedTime() C. getMaxInactiveInterval() D. getLastAccessTime() -
B
A
B
Which of the following statements are correct about HTTP Basic authentication mechanism?
A. HTML FORM is used to capture username and password B. Password is transmitted either in encrypted text or in plain text depending on the browser C. Password is transmitted in an encrypted form D. Password is transmitted as text -
D
Which of the following statement is correct?
A. Authentication means determining whether one has access to a particular resource or not B. Confidentiality and Authorization are one and the same thing C. Authentication means proving whether one is what one claims to be -
C
C
In which of the following cases will the method doEndTag() of a tag handler be invoked?
A. It will be invoked only if doStartTag() or doAfterBody() return Tag.DO_END_TAG B. It will be invoked only if doStartTag() and doAfterBody() complete successfully C. This method is invoked if doStartTag() method returns true D. It will be invoked in all case even if doStartTag() or doAfterBody() throw an exception -
A
The path in a URL typically specifies a resource's exact location on the server
A. False B. True -
B
Which of the following classes define the methods setStatus(...) and sendError(...) used to send an HTTP error back to the browser?
A. Both are defined in HttpServletResponse B. Both are defined in ServletRequest C. Both are defined in ServletResponse D. Both are defined in HttpServletRequest -
A
D
Which of the following file is the correct name and location of deployment descriptor of a web application? Assume that the web application is rooted at \doc-root.
A. \doc-root\dd.xml B. \doc-root\web.xml C. \doc-root\WEB-INF\web.xml D. \doc-root\WEB_INF\dd.xml E. \doc-root\WEB-INF\dd.xml F. \doc-root\WEB_INF\web.xml -
C
A
Which directory is legal location for the deployment descriptor file? Note that all paths are shown as from the root of the web application directory
A. \WEB-INF B. \WEB-INF\xml C. \WEB-INF\classes -
A
A
C
D
Identify the method used to get an object available in a session.
A. getValue of Session B. getValue of HttpSession C. getAttribute of Session D. getAttribute of HttpSession -
D
B
D
B
A
A
Session death is more likely to come about through a time-out mechanism. If there is no activity on a session for a predefined length of time, the web container invalidates the session.
A. False B. True -
B
C
Study the statements:
Every web application within a web container has a unique context path
The context path and any directories you choose to create within it contain resources that are accessible through HTTP
A. Only statement 1 is true B. Only statement 2 is true C. Both 1 and 2 are true D. Both 1 and 2 are false -
C
Servlets usually are used on the client side of a networking application.
A. False B. True -
A
B
Which jsp tag can be used to set bean property?
A. jsp:useBean.setProperty B. jsp:useBean.property C. jsp:setProperty D. jsp:property E. jsp:useBean -
C
C
Your web application named "FWorks" uses SpecialMath.class. This is an unbundled class and is not contained in any jar file. Where will you keep this class file?
A. FWorks/WEB-INF/classes B. FWorks/classes C. FWorks/WEB-INF D. FWorks/WEB-INF/lib/classes -
A
You need to modify the deployment descriptor for a web application installed in MyWebApp directory. Which file would you look for?
A. MyWebApp.xml MyWebApp B. web.xml in MyWebApp C. MyWebApp.xml in MyWebApp/WEB-INF D. web.xml in MyWebApp/WEB-INF -
D
A
The deployment descriptor of a web application must have the name web.xml. In the same way the tag librapy descriptor file must be called taglib.xml
A. True B. False -
B
A JavaBeans component has the following field. private boolean enabled Which pairs of method declarations follow the JavaBeans standard for accessing this field?
A. public boolean setEnabled( boolean enabled) public boolean getEnabled() B. public void setEnabled(boolean enabled) public boolean getEnabled() C. public Boolean setEnabled( boolean enabled) public boolean isEnabled() D. public void setEnabled( boolean enabled) public void isEnabled() -
B
Which is NOT a scope of implicit objects of JSP file?
A. application B. session C. page D. request E. response -
E
JSP ____ let you inserts arbitrary code into servlet's jspService method (which is called by service)
A. declarations B. scriptlets C. expressions -
B
(Choose 1 answer) Study the statements:
The context path contains a special directopy called WEB-INF which contains the deployment descriptor file web.xml
A client application may directly access resources in WEB-INF or Its subdirectones through HTTP_
A. Both 1 and 2 are true B. Only statement 1 is true C. Only statement 2 is true D. Both 1 and 2 are not true -
B
B
When implementing a tag, if the tag does not include the body, then the tag handler class must extend the BodyTagSupport class. Is this statement true of false?
A. True B. False -
B
A
A
Which of these is legal attribute of page directive?
A. include B. scope C. errorPage D. debug -
C
E
Consider the HTML code below. Which of the following method calls can retrieve the "email" value sent from the browser? (Choose one)
A. getFormValue("email") of HttpServletRequest B. getParameters("email") of HttpServlet C. getParameter("email") of ServletRequest D. getField("email") of HttpServletRequest -
C
E
Which of the following implicit variables should be used by a jsp page to access a resource and to foward a request to another jsp page?(Choose one)
A pageContext and config B config and pageContext C application for both D config for both. -
A
How can you ensure the continuity of the session while using HttpServletResponse.sendRedirect() method when cookies are not supported by the client?
A By using hidden parameters. B By using HttpServletRequest.encodeURL() method. C By enconding the redirect path with HttpServletResponse.encodeRedirectURL() method D HttpServletResponse.encodeRedirectURL() method -
C
In which of the following case will the method doStartTag() of a tag handler be invoked?
A. If doEndTag() returns EVAL TAG AGAIN B. This method is invoked if doTag() method returns true. C. It will be invoked only If the use of that tag is not enclosed in another custom tag. D. This method is invoked if doTag() method returns DO START E. This method is always invoked whenever the tag's use is encountered in the jsp page. -
E
C
Which of the following defines the type of the content that a tag can accept?
A. content-type B. body-content C. content D. tag-content-type -
B
Host names are translated into IP addresses by web servers.
A. False B. True -
A
B
Which technology is used for processing HTTP requests and mapping those requests to business objects
A. EJB B. JMS C. Servlets D. MOM (Message-Oriented Middleware Product) -
C
(Choose 1 answer) Which of the statements regarding the following code are correct? public void doPost(HttpServletRequest req. HttpServletResponse res) throws lOException. ServletException { res.getWriter().print("Hello"); RequestDispatcher rd = getServletContext().getRequestDispatcher("test.jsp"); rd.include(req, res); res.getWriter().print("World"): } A. Only "World" will be a part of the output B. Neither will be a part of the output C. Only "Hello" will be a part of the output D. "Hello" and "World" both will be a part of the output -
D
A
Which of the following statements is correct? Select the one correct answer.
A. The response from the server to a GET request does not contain a document B. The setStatus method defined in the HttpServletRequest class takes an int as an argument and sets the status of Http response C. The response from the server to a HEAD request consists of status line, content type and the document D. The HttpServletResponse defines constants like SC_NOT_FOUND that may be used as a parameter to setStatus method. -
D
Which is NOT associated with the business tier in a JEE (J2EE) web-based application? A. Entity Beans B. JSP C. Stateless Session Beans -
B
Which option can be used to predefine Java Persistence queries for easy use? A. @NamedNativeQuery annotation B. @NamedQuery annotation C. using the named-native-query element in the XML descriptor -
B
Which of the following is a sensible way of sending an error page to the client in case of a business exception that extends from java.lang.Exception? (Choose one) A. Don't do anything, the servlet container will automatically send a default error page. B. Don't catch the exception and define the 'exception to error-page' mapping in web.xml C. Catch the exception, wrap it into ServletException and define the 'business exception to error-page' mapping in web.xml -
C
Which of the following task may happen in the translation phase of JSP page? (Choose one) A. Instantiation of the servlet class. B. Creation of the servlet class corresponding to the JSP file. C. None of the others D. Execution of JspServiceQ method. -
B
D
Which security mechanism proves that data has not been tampered with during its transit through the network? A. Packet sniffing B. Data integrity C. Data validation D. Authentication E. Data privacy F. Authorization -
B
What would be the best directory in which to store a supporting JAR file for a web application? Note that in the list below, all directories begin from the context root A. \WEB-INF\lib B. \jars C. \WEB-INF D. \WEB-INF\classes -
A
C
Which is NOT a core component of JSP? A. actions B. name of a jsp file C. tag libraries D. scriptlets E. directives -
D
Which of the following methods can be used to add cookies to a servlet response? A. HttpServletResponse.addCookie(Cookie cookie) B. ServletResponse.addCookie(Cookie cookie) C. ServletResponse.addCookie(String contents) D. HttpServletResponse.addCookie(String contents) E. ServletResponse.addHeader(String name. String value) -
A
A Java developer needs to be able to send email, containing XML attachments, using SMTP. Which JEE (J2EE) technology provides this capability? A. Servlet B. JSP C. EJB D. JavaMail -
D
Which is NOT a correct statement about entity beans? A. They are used to share data among clients B. They are used to store persistent data C. They are used to represent data stored in a RDBMS D. They are used to implement business processes -
D
A JSP _____ 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). A. expression B. scriptlet c. declaration -
C
You have to send a pdf file to the client as a response to a request. Which of the following calls will you have to make? (Choose one) A. response.setType("application/pdf"); B. response.setContentType("image/pdf"); C. response.setContentType("application/pdf"); D. response.setType("image/pdf); -
C
Identify the technique that can be used to implement 'sessions' if the client browser does not support cookies.(Choose one) A. It cannot be done without cookie support B. Using Http headers. C. URL Writing D. Hidden form fields. -
D
B
B
Study the statements:
The special directory /WEB-INF/lib contains Java class files—servlets and supporting code.
The special directory /WEB-INF/classes contains JAR files with supporting libraries of code. A. Only statement 1 is true B. Only statement 2 is true C. Both 1 and 2 are true D. Both 1 and 2 are not true -
D
A
Given that a servlet has been mapped to /account/. Identity the HttpServletRequest methods that will return the /myapp segement for the URL: /myapp/account/. A. getPathInfo B. getServletPath C. getContextPath -
C
B C
Name the class that includes the SetSession method that is used to get the HttpSession object A. HttpSevletRequest B. HttpSevletResponse C. SessionContext D. SessionConfig -
A