Click the Exhibit button.
Given:
11.<% com.example.Advisor advisor = new com.example.Advisor(); %>
12.<% request.setAttribute("foo", advisor); %>
Assuming there are no other "foo" attributes in the web application,which three are valid EL expressions forretrieving the advice property of advisor?()
A.${foo.advice}
B.${request.foo.advice}
C.${requestScope.foo.advice}
D.${requestScope[foo[advice]]}
E.${requestScope["foo"]["advice"]}
您可能感興趣的試卷
你可能感興趣的試題
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’ %>
最新試題
Click the 'Select and Place' button.Place the events in the order they occur.
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 two are valid and equivalent?()
Click the ’Select and Place’ button.Place the events in the order they occur.
Click the ’Select and Place’ button.Place the events in the order they occur.
A web application allows the HTML title banner to be set using a servlet context initialization parametercalled titleStr.Which two properly set the title in this scenario?()
Click the ’Select and Place’ button.Place the events in the order they occur.
Click the 'Select and Place' button.Place the events in the order they occur.
Click the ’Select and Place’ button.Place the events in the order they occur.
Your IT department is building a lightweight Front Controller servlet that invokes an application logic objectwith the interface:public interface ApplicationController {public String invoke(HttpServletRequest request)}The return value of this method indicates a symbolic name of the next view. From this name, the FrontController servlet looks up the JSP URL in a configuration table. This URL might be an absolute path or apath relative to the current request. Next, the Front Controller servlet must send the request to this JSP togenerate the view. Assume that the servlet variable request is assigned the current HttpServletRequestobject and the variable context is assigned the webapp’s ServletContext. Which code snippet of the FrontController servlet accomplishes this goal?()