Java认证考试

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?()A、<!-- this is a comment -->B、<% // this is a comment %>C、<%-- this is a comment --%>D、<% /** this is a comment **/ %>

题目

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?()

  • A、<!-- this is a comment -->
  • B、<% // this is a comment %>
  • C、<%-- this is a comment --%>
  • D、<% /** this is a comment **/ %>
如果没有搜索结果,请直接 联系老师 获取答案。
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Youarebuildingyourownlayoutmechanismbyincludingdynamiccontentforthepage’sheaderandfootersections.Thefooterisalwaysstatic,buttheheadergeneratesthe<title>tagthatrequiresthepagenametobespecifieddynamicallywhentheheaderisimported.WhichJSPcodesnippetperformstheimportoftheheadercontent?()

A.<jsp:includepage=’/WEB-INF/jsp/header.jsp’><jsp:paramname=’pageName’value=’WelcomePage’/></jsp:include>

B.<jsp:importpage=’/WEB-INF/jsp/header.jsp’><jsp:paramname=’pageName’value=’WelcomePage’/></jsp:import>

C.<jsp:includepage=’/WEB-INF/jsp/header.jsp’><jsp:attributename=’pageName’value=’WelcomePage’/>.</jsp:include>

D.<jsp:importpage=’/WEB-INF/jsp/header.jsp’>.<jsp:attributename=’pageName’value=’WelcomePage’/>.</jsp:import>


参考答案:A

第2题:

YouhaveanewITmanagerthathasmandatedthatallJSPsmustberefactoredtoincludenoscritpletcode.TheITmanagerhasaskedyoutoenforcethis.Whichdeploymentdescriptorelementwillsatisfythisconstraint?()

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>


参考答案:D

第3题:

下列那个jsp标记用于得到一个javabean的属性()

A、jsp:useBean

B、jsp:useBean.property

C、jsp:useBean.getProperty

D、jsp:getProperty


正确答案:D

第4题:

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:declaration>int count = 0;<jsp:declaration>
  • B、<%! int count = 0; %>
  • C、<jsp:declaration.instance>int count = 0;. <jsp:declaration.instance>
  • D、<jsp:scriptlet.declaration>int count = 0;. <jsp:scriptlet.declaration>

正确答案:A

第5题:

WhichJSPstandardactioncanbeusedtoimportcontentfromaresourcecalledfoo.jsp?()

A.<jsp:importfile=’foo.jsp’/>

B.<jsp:importpage=’foo.jsp’/>

C.<jsp:includepage=’foo.jsp’/>

D.<jsp:includefile=’foo.jsp’/>


参考答案:C

第6题:

Whichtwoarevalidandequivalent?()

A.<%!inti;%>

B.<%=inti;%>

C.<jsp:expr>inti;</jsp:expr>

D.<jsp:scriptlet>inti;</jsp:scriptlet>

E.<jsp:declaration>inti;</jsp:declaration>


参考答案:A, E

第7题:

Formanageabilitypurposes,youhavebeentoldtoadda"count"instancevariabletoacriticalJSP DocumentsothataJMXMBeancantrackhowfrequentthisJSPisbeinginvoked.WhichJSPcodesnippetmustyouusetodeclarethisinstancevariableintheJSPDocument?()

A.<jsp:declaration>intcount=0;<jsp:declaration>

B.<%!intcount=0;%>

C.<jsp:declaration.instance>intcount=0;.<jsp:declaration.instance>

D.<jsp:scriptlet.declaration>intcount=0;.<jsp:scriptlet.declaration>


参考答案:A

第8题:

JSP EL表达式的语法为( )

A、!JSP expression

B、@{JSP expression}

C、${JSP expression}

D、#{JSP expression}


正确答案:C

第9题:

有三个页面,a.jsp,b.jsp和c.jsp,流程是:a.jsp->b.jsp->c.jsp,其中a.jsp中提交的数据要在c.jsp中访问,用最简单的方法 怎么做?注意不能放在session里


正确答案:

 

用隐藏表单域,即在b.jsp页面中用N个hidden把上一页面提交过来的信息保存下来,然后和当前一起提交,再到c.jsp里面获取
说明:尽量不要用session和少用session

第10题:

下列选项中不属于JSP标准动作的是()

  • A、jsp:forward
  • B、c:out
  • C、jsp:useBean
  • D、jsp:setProperty

正确答案:C

更多相关问题