单选题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} %>


参考解析

解析: 暂无解析

相关考题:

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

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++; %

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 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 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 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 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?()Athis.Init += new EventHandler(BindData); Bthis.PreRender += new EventHandler(BindData); ClstLanguages.PreRender += new EventHandler(BindData); DlstLanguages.SelectedIndexChanged += new EventHandler(BindData);

单选题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?()Ajsp:include page=’/WEB-INF/jsp/header.jsp’jsp:param name=’pageName’ value=’Welcome Page’ / /jsp:includeBjsp:import page=’/WEB-INF/jsp/header.jsp’jsp:param name=’pageName’ value=’Welcome Page’ / /jsp:importCjsp:include page=’/WEB-INF/jsp/header.jsp’jsp:attribute name=’pageName’ value=’Welcome Page’ / . /jsp:includeDjsp: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 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?()AMessage: b${exception.message}/bBMessage: b${exception.errorMessage}/bCMessage: b${request.exception.message}/bDMessage: b${pageContext.exception.message}/bEMessage: 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") { 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.

单选题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?()Aby setting the SQL_TRACE parameter to FALSE in the parameter fileBby using DBMS_MONITOR.SESSION_TRACE_DISABLE to disable the tracing for the user sessionCby setting the SQL_TRACE parameter to FALSE by using the ALTER SYSTEM command in the user sessionDby setting the SQL_TRACE parameter to FALSE by using the ALTER SESSION command in the user session

多选题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.

单选题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 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

单选题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?()AInitBLoadCPreInitDPreLoad

单选题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

单选题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++; %

单选题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

单选题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?()Ajsp:declarationint count = 0;jsp:declarationB%! int count = 0; %Cjsp:declaration.instanceint count = 0;. jsp:declaration.instanceDjsp:scriptlet.declarationint count = 0;. jsp:scriptlet.declaration