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
最新試題
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?
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 <title> tag that requires the page name tobe specified dynamically when the header is imported.Which JSP code snippet performs the import of theheader content?()
Which is true about the web container request processing model?()
Which ensures that a JSP response is of type "text/plain"?()
Click the Exhibit button.The attribute "name" has a value of "Foo,"What is the result if this tag handler’s tag is invoked?()
Which is a benefit of precompiling a JSP page?()
Click the ’Select and Place’ button.Place the events in the order they occur.
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.<input type=’radio’ name=’hobbyEnum’ value=’HIKING’>Hiking <br>21.<input type=’radio’ name=’hobbyEnum’ value=’SKIING’>Skiing <br>22.<input type=’radio’ name=’hobbyEnum’ value=’SCUBA’>SCUBA Diving23.<!-- and more options -->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?()
Click the ’Select and Place’ button.Place the events in the order they occur.
A web browser need NOT always perform a complete request for a particular page that it suspects mightNOT have changed. The HTTP specification provides a mechanism for the browser to retrieve only a partialresponse from the web server; this response includes information, such as the Last-Modified date but NOTthe body of the page.Which HTTP method will the browser use to retrieve such a partial response?()