Your company has a corporate policy that prohibits storing a customer’s credit card number in anycorporate database. However, users have complained that they do NOT want to re- enter their credit cardnumber for each transaction. Your management has decided to use client-side cookies to record the user’scredit card number for 120 days. Furthermore, they also want to protect this information during transit fromthe web browser to the web container; so the cookie must only be transmitted over HTTPS.
Which codesnippet creates the "creditCard" cookie and adds it to the out going response to be stored on the user’s webbrowser?()
A.
B.
C.
D.
您可能感興趣的試卷
你可能感興趣的試題
Your IT department is building a lightweight Front Controller servlet that invokes an application logic objectwith the interface:
public interface ApplicationController {public String invoke(HttpServletRequest request)}
The return value of this method indicates a symbolic name of the next view. From this name, the FrontController servlet looks up the JSP URL in a configuration table. This URL might be an absolute path or apath relative to the current request. Next, the Front Controller servlet must send the request to this JSP togenerate the view. Assume that the servlet variable request is assigned the current HttpServletRequestobject and the variable context is assigned the webapp’s ServletContext.
Which code snippet of the FrontController servlet accomplishes this goal?()
A.Dispatcher view=context.getDispatcher(viewURL);view.forward Request(request, response);
B.Dispatcher view=request.getDispatcher(viewURL);view.forward Request(request, response);
C.RequestDispatcher view. =context.getRequestDispatcher(viewURL);view.forward(request,response);
D.RequestDispatcher view=request.getRequestDispatcher(viewURL);view.forward(request, response);
A.The init method on a filter is called the first time a servlet mapped to that filter is invoked.
B.A filter defined for a servlet must always forward control to the next resource in the filter chain.
C.Filters associated with a named servlet are applied in the order they appear in the web application deployment descriptor file.
D.If the init method on a filter throws an UnavailableException, then the container will make no further attempt to execute it.
A.A filter must implement the destroy method.
B.A filter must implement the doFilter method.
C.A servlet may have multiple filters associated with it.
D.A servlet that is to have a filter applied to it must implement the javax.servlet.FilterChain interface.
E.A filter that is part of a filter chain passes control to the next filter in the chain by invoking the FilterChain.forward method.
All of your JSPs need to have a link that permits users to email the web master. This web application islicensed to many small businesses, each of which have a different email address for the web master. Youhave decided to use a context parameter that you specify in the deployment descriptor, like this:
42.<context-param>
43.<param-name>webmasterEmail</param-name>
44.<param-value>master@example.com</param-value>
45.</context-param>
Which JSP code snippet creates this email link?()
A.<a href=’mailto:${contextParam.webmasterEmail}’>contact us</a>
B.<a href=’mailto:${applicationScope.webmasterEmail}’>contact us</a>
C.<a href=’mailto:${contextInitParam.webmasterEmail}’>contact us</a>
D.<a href=’mailto:${initParam.webmasterEmail}’>contact us</a>
A.<%@ page mimeType="text/plain" %>
B.<%@ page contentType="text/plain" %>
C.<%@ page pageEncoding="text/plain" %>
D.<%@ page contentEncoding="text/plain" %>
E.<% response.setEncoding("text/plain"); %>
最新試題
Click the ’Select and Place’ button.Place the events in the order they occur.
Click the ’Select and Place’ button.Place the events in the order they occur.
Given a web application in which the request parameter productID contains a product identifier.Which twoEL expressions evaluate the value of the productID?()
The JSP developer wants a comment to be visible in the final output to the browser.Which comment styleneeds to be used in a JSP page?()
Your IT department is building a lightweight Front Controller servlet that invokes an application logic objectwith the interface:public interface ApplicationController {public String invoke(HttpServletRequest request)}The return value of this method indicates a symbolic name of the next view. From this name, the FrontController servlet looks up the JSP URL in a configuration table. This URL might be an absolute path or apath relative to the current request. Next, the Front Controller servlet must send the request to this JSP togenerate the view. Assume that the servlet variable request is assigned the current HttpServletRequestobject and the variable context is assigned the webapp’s ServletContext.Which code snippet of the FrontController servlet accomplishes this goal?()
Given a Filter class definition with this method:21.public void doFilter(ServletRequest request,22.ServletResponse response,23.FilterChain chain)24.throws ServletException, IOException {25.// insert code here26.}Which should you insert at line 25 to properly invoke the next filter in the chain, or the target servlet if thereare no more filters?()
Click the 'Select and Place' button.Place the events in the order they occur.
All of your JSPs need to have a link that permits users to email the web master. This web application islicensed to many small businesses, each of which have a different email address for the web master. Youhave decided to use a context parameter that you specify in the deployment descriptor, like this:42.<context-param>43.<param-name>webmasterEmail</param-name>44.<param-value>master@example.com</param-value>45.</context-param>Which JSP code snippet creates this email link?()
Click the ’Select and Place’ button.Place the events in the order they occur.
Which ensures that a JSP response is of type "text/plain"?()