Given: 6.<% int[] nums = {42, 420, 4200}; 7.request.setAttribute("foo", nums); %> Which two successfully translate and result in a value of true?()
A.${true or false} B.${requestScope[foo][0] > 500} C.${requestScope[’foo’][1] = 420} D.${(requestScope[’foo’][0] lt 50) && (3 gt 2)}
单项选择题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 need to create a JSP that generates some JavaScript code to populate an array of strings used on theclient-side. Which JSP code snippet will create this array?()
A.MY_ARRAY = new Array();<% for ( int i = 0; i < serverArray.length; i++ ) { MY_ARRAY[<%= i %>] = ’<%= serverArray[i] %>’;} %> B.MY_ARRAY = new Array();. <% for ( int i = 0; i < serverArray.length; i++ ) { . MY_ARRAY[${i}] = ’${serverArray[i]}’;. } %> C.MY_ARRAY = new Array();. <% for ( int i = 0; i < serverArray.length; i++ ) { %> . MY_ARRAY[<%= i %>] = ’<%= serverArray[i] %>’;. <% } %> D.MY_ARRAY = new Array();<% for ( int i = 0; i < serverArray.length; i++ ) { %> . MY_ARRAY[${i}] = ’${serverArray[i]}’;. <% } %>
单项选择题You have a new IT manager that has mandated that all JSPs must be refactored to include no scritpletcode. The IT manager has asked you to enforce this. Which deployment descriptor element will satisfy thisconstraint?()
A.<jsp-property-group>. <url-pattern>*.jsp</url-pattern>. <permit-scripting>false</permit-scripting>. </jsp-property-group> B.<jsp-config>. <url-pattern>*.jsp</url-pattern><permit-scripting>false</permit-scripting>. </jsp-config> C.<jsp-config>. <url-pattern>*.jsp</url-pattern>. <scripting-invalid>true</scripting-invalid>. </jsp-config> D.<jsp-property-group>. <url-pattern>*.jsp</url-pattern>. <scripting-invalid>true</scripting-invalid>. </jsp-property-group>
单项选择题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’ %>
多项选择题Your web application requires the ability to load and remove web files dynamically to the web container’s filesystem. Which two HTTP methods are used to perform these actions?()
A.PUT B.POST C.SEND D.DELETE E.REMOVE