网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
You are building a Front Controller using a JSP page and you need to determine if the user’s session hasNOT been created yet and perform some special processing for this case. Which scriptlet code snippet willperform this test?()
- A、<% if ( request.getSession(false) == null ) {// special processing} %>
- B、<% if ( request.getHttpSession(false) == null ) {// special processing} %>
- C、<% if ( requestObject.getSession(false) == null ) { // special processing} %>
- D、<% if ( requestObject.getHttpSession(false) == null ) { // special processing} %>
参考答案
更多 “ You are building a Front Controller using a JSP page and you need to determine if the user’s session hasNOT been created yet and perform some special processing for this case. Which scriptlet code snippet willperform this test?()A、% if ( request.getSession(false) == null ) {// special processing} %B、% if ( request.getHttpSession(false) == null ) {// special processing} %C、% if ( requestObject.getSession(false) == null ) { // special processing} %D、% if ( requestObject.getHttpSession(false) == null ) { // special processing} %” 相关考题
考题
You create a master page named PageBase.master. The master page contains a Label control named lblTitle.You create a content page that references the master page.You need to change the Text property of the master page‘s lblTitle control from the content page.Which code segment should you use?()A.B.C.D.
考题
For manageability purposes, you have been told to add a "count" instance variable to a critical JSP Document so that a JMX MBean can track how frequent this JSP is being invoked. Which JSP code snippetmust you use to declare this instance variable in the JSP Document?()A、jsp:declarationint count = 0;jsp:declarationB、%! int count = 0; %C、jsp:declaration.instanceint count = 0;. jsp:declaration.instanceD、jsp:scriptlet.declarationint count = 0;. jsp:scriptlet.declaration
考题
Every page of your web site must include a common set of navigation menus at the top of the page. Thismenu is static HTML and changes frequently,so you have decided to use JSP’s static import mechanism. Which JSP code snippet accomplishes this goal?()A、%@ import file=’/common/menu.html’ %B、%@ page import=’/common/menu.html’ %C、%@ import page=’/common/menu.html’ %D、%@ include file=’/common/menu.html’ %E、%@ page include=’/common/menu.html’ %
考题
For debugging purposes, you need to record how many times a given JSP is invoked before the user’ssession has been created. The JSP’s destroy method stores this information to a database. Which JSPcode snippet keeps track of this count for the lifetime of the JSP page?()A、%! int count = 0; %% if ( request.getSession(false) == null ) count++; %B、%@ int count = 0; %. % if ( request.getSession(false) == null ) count++; %C、% int count = 0;. if ( request.getSession(false) == null ) count++; %D、%@ int count = 0;. if ( request.getSession(false) == null ) count++; %E、%! int count = 0;. if ( request.getSession(false) == null ) count++; %
考题
You create an ASP.NET page named TestPage.aspx that contains validation controls. You need to verify that all input values submitted by the user have been validated by testing the Page.IsValid property. Which page event should you add an event handler to?()A、InitB、LoadC、PreInitD、PreLoad
考题
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a page that contains the following code fragment: You write the following code segment in the code-behind file for the page: void BindData(object sender, EventArgs e) { lstLanguages.DataSource = CultureInfo.GetCultures(CultureTypes.AllCultures); lstLanguages.DataTextField = "EnglishName"; lstLanguages.DataBind(); } You need to ensure that the lstLanguages ListBox control maintains the selection of the user during postback. Which line of code should you insert in the constructor of the page?()A、this.Init += new EventHandler(BindData); B、this.PreRender += new EventHandler(BindData); C、lstLanguages.PreRender += new EventHandler(BindData); D、lstLanguages.SelectedIndexChanged += new EventHandler(BindData);
考题
A JSP page needs to perform some operations before servicing the first request. Where can this be done?()A、 within a method called jspInitB、 within the page directive of the JSP pageC、 within a scriptlet at the top of the JSP pageD、 within the XML element
考题
In a JSP-centric web application, you need to create a catalog browsing JSP page. The catalog is stored asa List object in the catalog attribute of the webapp’s ServletContext object. Which scriptlet code snippetgives you access to the catalog object?()A、% List catalog = config.getAttribute("catalog"); %B、% List catalog = context.getAttribute("catalog"); %C、% List catalog = application.getAttribute("catalog"); %D、% List catalog = servletContext.getAttribute("catalog"); %
考题
You are creating a new JSP page and you need to execute some code that acts when the page is firstexecuted, but only once. Which three are possible mechanisms for performing this initialization code?()A、In the init method.B、In the jspInit method.C、In the constructor of the JSP’s Java code.D、In a JSP declaration, which includes an initializer block.E、In a JSP declaration, which includes a static initializer block.
考题
You have created a JSP that includes instance variables and a great deal of scriptlet code. Unfortunately,after extensive load testing, you have discovered several race conditions in your JSP scriptlet code. To fixthese problems would require significant recoding, but you are already behind schedule. Which JSP codesnippet can you use to resolve these concurrency problems?()A、%@ page isThreadSafe=’false’ %B、%@ implements SingleThreadModel %C、%! implements SingleThreadModel %D、%@ page useSingleThreadModel=’true’ %E、%@ page implements=’SingleThreadModel’ %
考题
You are building a dating web site. The client’s date of birth is collected along with lots of other information.You have created an EL function with the signature: calcAge(java.util.Date):int and it is assigned to the name, age, in the namespace, funct. In one of your JSPsyou need to print a special message to clients who are younger than 25. Which EL code snippet will returntrue for this condition?()A、${calcAge(client.birthDate) 25}B、${calcAge[client.birthDate] 25}C、${funct:age(client.birthDate) 25}D、${funct:age[client.birthDate] 25}E、${funct:calcAge(client.birthDate) 25}
考题
You are building your own layout mechanism by including dynamic content for the page’s header and footersections. The footer is always static, but the header generates the tag that requires the page name tobe specified dynamically when the header is imported. Which JSP code snippet performs the import of theheader content?() titleA、jsp:include page=’/WEB-INF/jsp/header.jsp’jsp:param name=’pageName’ value=’Welcome Page’ / /jsp:includeB、jsp:import page=’/WEB-INF/jsp/header.jsp’jsp:param name=’pageName’ value=’Welcome Page’ / /jsp:importC、jsp:include page=’/WEB-INF/jsp/header.jsp’jsp:attribute name=’pageName’ value=’Welcome Page’ / . /jsp:includeD、jsp:import page=’/WEB-INF/jsp/header.jsp’. jsp:attribute name=’pageName’ value=’Welcome Page’ / . /jsp:import
考题
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’ % % } %B、jsp: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’ / . % } %D、jsp:if test=’request.isUserInRole("SalesManager")’ jsp:include file=’/WEB-INF/html/sales-mgr-menu.html’ / /jsp:if
考题
You are creating an error page that provides a user-friendly screen whenever a server exception occurs.You want to hide the stack trace, but you do want to provide the exception’s error message to the user sothe user can provide it to the customer service agent at your company. Which EL code snippet inserts thiserror message into the error page?()A、Message: b${exception.message}/bB、Message: b${exception.errorMessage}/bC、Message: b${request.exception.message}/bD、Message: b${pageContext.exception.message}/bE、Message: b${request.exception.errorMessage}/b
考题
You are developing a Web application. The Web application restricts access to an administrative page. The Web application uses the following code segment to protect the page.If Page.User.Identity.Name "CONTOSO/Administrator" Then Response.Redirect("login.aspx")End IfYou are logged on as Administrator. When you display the page, you are redirected to Login.aspx. You discover that the User.Identity.Name property is not being correctly populated. You need to ensure that you can access the page when you are logged on as Administrator. Which two actions should you perform? ()A、In the Web.config file, enable impersonation.B、In IIS, enable anonymous access.C、In IIS, disable anonymous access.D、In the Web.config file, set the authentication mode to Windows.
考题
You are the administrator of an Active Directory domain named A user reports that he cannot log on to a Windows Server 2003 computer that contains a critical application. You discover that the organizational unit (OU) in which the server is located was deleted. You discover that the user rights for this server are controlled by Group Policy. You need to restore access to the server. You need to achieve this goal by using the minimum amount of administrative effort. What should you do?()A、Perform a normal restoration of the System State data for the domain controller. Force replication.B、Perform an authoritative restoration of the System State data for the domain controller. Mark the OU for replication.C、Re-create the OU that was deleted. Reapply Group Policy, and then add the computer account and any necessary users or groups.D、Perform an Automated System Recovery (ASR) restoration on the domain controller.
考题
You are developing a Web application. The Web application restricts access to an administrative page. The Web application uses the following code segment to protect the page.if (Page.User.Identity.Name != @"CONTOSO/Administrator") { the page, you are redirected to Login.aspx. You discover that the User.Identity.Name property is not being correctly populated. You need to ensure that you can access the page when you are logged on as Administrator. Which two actions should you perform? ()A、In the Web.config file, enable impersonation.B、In IIS, enable anonymous access.C、In IIS, disable anonymous access.D、In the Web.config file, set the authentication mode to Windows.
考题
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a page that contains the following code fragment. | English | Chinese | Japan | Korean | - 92 - Test Information Co., Ltd. All rights reserved. You write the following code segment in the code-behind file for the page. void BindData(object sender, EventArgs e) { lstLanguages.DataSource = CultureInfo.GetCultures(CultureTypes.AllCultures); lstLanguages.DataTextField = "EnglishName"; lstLanguages.DataBind(); } You need to ensure that the lstLanguages ListBox control maintains the selection of the user during postback. Which line of code should you insert in the constructor of the page?()A、this.Init += new EventHandler(BindData); B、this.PreRender += new EventHandler(BindData); C、lstLanguages.PreRender += new EventHandler(BindData); D、lstLanguages.SelectedIndexChanged += new EventHandler(BindData);
考题
In your test database, you find that a user’s session is executing a lot of SQL statements, resulting in the generation of a large number of trace files. While investigating the reason, you find that SQL trace has been enabled at the instance level. You want to disable SQL trace, remotely, only for that user session to reduce the volume of trace data being generated.How do you achieve this objective?()A、 by setting the SQL_TRACE parameter to FALSE in the parameter fileB、 by using DBMS_MONITOR.SESSION_TRACE_DISABLE to disable the tracing for the user sessionC、 by setting the SQL_TRACE parameter to FALSE by using the ALTER SYSTEM command in the user sessionD、 by setting the SQL_TRACE parameter to FALSE by using the ALTER SESSION command in the user session
考题
单选题You are building your own layout mechanism by including dynamic content for the page’s header and footersections. The footer is always static, but the header generates the tag that requires the page name tobe specified dynamically when the header is imported. Which JSP code snippet performs the import of theheader content?()A
jsp:include page=’/WEB-INF/jsp/header.jsp’jsp:param name=’pageName’ value=’Welcome Page’ / /jsp:includeB
jsp:import page=’/WEB-INF/jsp/header.jsp’jsp:param name=’pageName’ value=’Welcome Page’ / /jsp:importC
jsp:include page=’/WEB-INF/jsp/header.jsp’jsp:attribute name=’pageName’ value=’Welcome Page’ / . /jsp:includeD
jsp:import page=’/WEB-INF/jsp/header.jsp’. jsp:attribute name=’pageName’ value=’Welcome Page’ / . /jsp:import
考题
单选题You create a method that runs by using the credentials of the end user. You need to use Microsoft Windows groups to authorize the user. You must add a code segment that identifies whether a user is in the local group named Clerk.Which code segment should you use?()A
AB
BC
CD
D
考题
多选题You are developing a Web application. The Web application restricts access to an administrative page. The Web application uses the following code segment to protect the page.if (Page.User.Identity.Name != @"CONTOSO/Administrator") { the page, you are redirected to Login.aspx. You discover that the User.Identity.Name property is not being correctly populated. You need to ensure that you can access the page when you are logged on as Administrator. Which two actions should you perform? ()AIn the Web.config file, enable impersonation.BIn IIS, enable anonymous access.CIn IIS, disable anonymous access.DIn the Web.config file, set the authentication mode to Windows.
考题
多选题You are creating a new JSP page and you need to execute some code that acts when the page is firstexecuted, but only once. Which three are possible mechanisms for performing this initialization code?()AIn the init method.BIn the jspInit method.CIn the constructor of the JSP’s Java code.DIn a JSP declaration, which includes an initializer block.EIn a JSP declaration, which includes a static initializer block.
考题
单选题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’ % % } %B
jsp: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’ / . % } %D
jsp: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?()A
jsp:insert page=’/WEB-INF/jsp/header.jsp’. ${pageTitle=’Welcome Page’}. /jsp:insertB
jsp:include page=’/WEB-INF/jsp/header.jsp’. ${pageTitle=’Welcome Page’}. /jsp:includeC
jsp:include file=’/WEB-INF/jsp/header.jsp’. ${pageTitle=’Welcome Page’}. /jsp:includeD
jsp:insert page=’/WEB-INF/jsp/header.jsp’. jsp:param name=’pageTitle’ value=’Welcome Page’ / . /jsp:insertE
jsp:include page=’/WEB-INF/jsp/header.jsp’. jsp:param name=’pageTitle’ value=’Welcome Page’ / . /jsp:include
考题
单选题You have created a JSP that includes instance variables and a great deal of scriptlet code. Unfortunately,after extensive load testing, you have discovered several race conditions in your JSP scriptlet code. To fixthese problems would require significant recoding, but you are already behind schedule. Which JSP codesnippet can you use to resolve these concurrency problems?()A
%@ page isThreadSafe=’false’ %B
%@ implements SingleThreadModel %C
%! implements SingleThreadModel %D
%@ page useSingleThreadModel=’true’ %E
%@ page implements=’SingleThreadModel’ %
考题
单选题For manageability purposes, you have been told to add a "count" instance variable to a critical JSP Document so that a JMX MBean can track how frequent this JSP is being invoked. Which JSP code snippetmust you use to declare this instance variable in the JSP Document?()A
jsp:declarationint count = 0;jsp:declarationB
%! int count = 0; %C
jsp:declaration.instanceint count = 0;. jsp:declaration.instanceD
jsp:scriptlet.declarationint count = 0;. jsp:scriptlet.declaration
热门标签
最新试卷