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 need to create a servlet filter that stores all request headers to a database for all requests to the webapplication’s home page "/index.jsp".
Which HttpServletRequest method allows you to retrieve all of therequest headers?()
A.String[] getHeaderNames()
B.String[] getRequestHeaders()
C.java.util.Iterator getHeaderNames()
D.java.util.Iterator getRequestHeaders()
E.java.util.Enumeration getHeaderNames()
A.response.setHeader("X-MyHeader", "34");
B.response.addHeader("X-MyHeader", "34");
C.response.setHeader(new HttpHeader("X-MyHeader", "34"));
D.response.addHeader(new HttpHeader("X-MyHeader", "34"));
E.response.addHeader(new ServletHeader("X-MyHeader", "34"));
最新試題
In which three directories, relative to a web application’s root, may a tag library descriptor file reside whendeployed directly into a web application?()
Which three are true about servlet filters?()
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?()
Which ensures that a JSP response is of type "text/plain"?()
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?()
Given tutorial.jsp:2.EL Tutorial3.Example 14.5.Dear ${my:nickname(user)}6.Which, when added to the web application deployment descriptor,ensures that line 5 is included verbatimin the JSP output?()
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?()
The JSP developer wants a comment to be visible in the final output to the browser.Which comment styleneeds to be used in a JSP page?()
Click the ’Select and Place’ button.Place the events in the order they occur.