SCWCD(310-083) 题目列表
多选题A developer wants a web application to be notified when the application is about to be shut down. Which two actions are necessary to accomplish this goal?()AInclude a listener directive in a JSP pageBconfigure a listener in the TLD file using the  elementCInclude a  element in the web application deployment descriptorDconfigure a listener in the application deployment descriptor, using the  elementEInclude a class implementing ServletContextListener as part of the web application deploymen

单选题A developer is designing the presentation tier for a web application that relies on a complex session bean.The session bean is still being developed and the APIs for it are NOT finalized. Any changes to the sessionbean API directly impacts the development of the presentation tier.  Which design pattern provides a meansto manage the uncertainty in the API?()AView HelperBFront ControllerCComposite ViewDIntercepting FilterEBusiness Delegate

单选题A developer has used this code within a servlet: 62.if(request.isUserInRole("vip")) { 63.// VIP-related logic here 64.} What else must the developer do to ensure that the intended security goal is achieved?()ACreate a user called vip in the security realmBDefine a group within the security realm and call it vipCDefine a security-role named vip in the deployment descriptorDDeclare a security-role-ref for vip in the deployment descripto

单选题You are building JSP pages that have a set of menus that are visible based on a user’s security role. Thesemenus are hand-crafted by your web design team; for example, the SalesManager role has a menu in thefile /WEB-INF/html/sales-mgr-menu.html. Which JSP code snippet should be used to make this menuvisible to the user?()A% if ( request.isUserInRole(SalesManager) ) { % %@ include file=’/WEB-INF/html/sales-mgr-menu.html’ % % } %Bjsp:if test=’request.isUserInRole(SalesManager)’ %@ include file=’/WEB-INF/html/sales-mgr-menu.html’ % /jsp:ifC% if ( request.isUserInRole(SalesManager) ) { % . jsp:include file=’/WEB-INF/html/sales-mgr-menu.html’ / . % } %Djsp:if test=’request.isUserInRole(SalesManager)’ jsp:include file=’/WEB-INF/html/sales-mgr-menu.html’ / /jsp:if

单选题Your web application views all have the same header, which includes the  tag in the  elementof the rendered HTML. You have decided to remove this redundant HTML code from your JSPs and put itinto a single JSP called /WEB-INF/jsp/header.jsp. However, the title of each page is unique, so you havedecided to use a variable called pageTitle to parameterize this in the header JSP, like this: 10.${param.pageTitle} Which JSP code snippet should you use in your main view JSPs to insert the header and pass thepageTitle variable?()Ajsp:insert page=’/WEB-INF/jsp/header.jsp’. ${pageTitle=’Welcome Page’}. /jsp:insertBjsp:include page=’/WEB-INF/jsp/header.jsp’. ${pageTitle=’Welcome Page’}. /jsp:includeCjsp:include file=’/WEB-INF/jsp/header.jsp’. ${pageTitle=’Welcome Page’}. /jsp:includeDjsp:insert page=’/WEB-INF/jsp/header.jsp’. jsp:param name=’pageTitle’ value=’Welcome Page’ / . /jsp:insertEjsp:include page=’/WEB-INF/jsp/header.jsp’. jsp:param name=’pageTitle’ value=’Welcome Page’ / . /jsp:include

多选题Given a header in an HTTP request:X-Retries:4 Which two retrieve the value of the header from a given HttpServletRequest request?()ARequest.getHeader(X-Retries)BRequest.getIntHeader(X-Retries)CRequest.getRequestHeader(X-Retries)DRequest.getHeaders(X-Retries).get(0)ERequest.getRequestHeaders(X-Retries).get(0)

单选题You are building a dating service web site. Part of the form to submit a client’s profile is a groupIIof radio buttons for the person’s hobbies: 20.Hiking  21.Skiing  22.SCUBA Diving 23. After the user submits this form, a confirmation screen is displayed with these hobbies listed. Assume thatan application-scoped variable, hobbies, holds a map between the Hobby enumerated type and the displayname. Which EL code snippet will display Nth element of the user’s selected hobbies?()A${hobbies[hobbyEnum[N]}B${hobbies[paramValues.hobbyEnum[N]]}C${hobbies[paramValues@’hobbyEnum’@N]}D${hobbies.get(paramValues.hobbyEnum[N])}E${hobbies[paramValues.hobbyEnum.get(N)]}

多选题A JSP page needs to instantiate a JavaBean to be used by only that page.  Which two jsp:useBeanattributes must be used to access this attribute in the JSP page?()AIdBTypeCNameDClassEYscope

多选题A web application contains a tag file called beta.tag in /WEB-INF/tags/alpha. A JSP page called sort.jspexists in the web application and contains only this JSP code: 1. 3. The sort.jsp page is requested. Which two are true?()ATag files can only be accessed using a tagdir attribute.BThe sort.jsp page translates successfully and invokes the tag defined by beta.tag.CThe sort.jsp page produces a translation error because a taglib directive must always have a uriattribute.DTag files can only be placed in /WEB-INF/tags, and NOT in any subdirectories of /WEB- INF/tags.EThe tagdir attribute in line 2 can be replaced by a uri attribute if a TLD referring to beta.tag is createdand added to the web application.

单选题You are building a web application with a scheduling component. On the JSP, you need to show the currentdate, the date of the previous week, and the date of the next week. To help you present this information,you have created the following EL functions in the ’d’ namespace: name: curDate; signature: java.util.DatecurrentDate() name: addWeek; signature: java.util.Date addWeek(java.util.Date, int) name: dateString;signature:java.util.String getDateString(java.util.Date) Which EL code snippet will generate the string for the previousweek?A${d:dateString(addWeek(curDate(), -1))}B${d:dateString[addWeek[curDate[], -1]]}C${d:dateString[d:addWeek[d:curDate[], -1]]}D${d:dateString(d:addWeek(d:curDate(), -1))}

多选题Given an HttpServletRequest request: 22.String id = request.getParameter("jsessionid"); 23.// insert code here 24.String name = (String) session.getAttribute("name"); Which three can be placed at line 23 to retrieve anexisting HttpSession object?()AHttpSession session = request.getSession();BHttpSession session = request.getSession(id);CHttpSession session = request.getSession(true);DHttpSession session = request.getSession(false);EHttpSession session = request.getSession(jsessionid);

单选题To take advantage of the capabilities of modern browsers that use web standards, such as XHTML andCSS, your web application is being converted from simple JSP pages to JSP Document format. However,one of your JSPs, /scripts/screenFunctions.jsp, generates a JavaScript file. This file is included in severalweb forms to create screen-specific validation functions and are included in these pages with the followingstatement: 10. 11.  14. 15. Which JSP code snippet declares that this JSP Document is a JavaScript file?()A%@ page contentType=’application/javascript’ %Bjsp:page contentType='application/javascript' /Cjsp:document contentType='application/javascript' /Djsp:directive.page contentType='application/javascript' /ENo declaration is needed because the web form XHTML page already declares the MIME type of the /scripts/screenFunctions.jsp file in the script tag. tag.

单选题You have a use case in your web application that adds several session-scoped attributes. At the end of theuse case, one of these objects, the manager attribute, is removed and then it needs to decide which of theother session-scoped attributes to remove. How can this goal be accomplished?()AThe object of the manager attribute should implement the HttpSessionBindingListener and it should call the removeAttribute method on the appropriate session attributes.BThe object of the manager attribute should implement the HttpSessionListener and it should call the removeAttribute method on the appropriate session attributes.CThe object of the manager attribute should implement the HttpSessionBindingListener and it should call the deleteAttribute method on the appropriate session attributes.DThe object of the manager attribute should implement the HttpSessionListener and it should call the deleteAttribute method on the appropriate session attributes.

多选题Which two are characteristics of the Service Locator pattern?()AIt encapsulates component lookup procedures.BIt increases source code duplication and decreases reuse.CIt improves client performance by caching context and factory objects.DIt degrades network performance due to increased access to distributed lookup services.

单选题Which statement is true if the doStartTag method returns EVAL_BODY_BUFFERED?()AThe tag handler must implement BodyTag.BThe doAfterBody method is NOT called.CThe setBodyContent method is called once.DIt is never legal to return EVAL_BODY_BUFFERED from doStartTag.