参考答案和解析
正确答案: JSP(Java Server Pages)是由Sun Microsystems公司倡导、许多公司参与一起建立的一种动态网页技术标准。JSP技术有点类似ASP技术,它是在传统的网页HTML文件(*.htm,*.html)中插入Java程序段(Scriptlet)和JSP标记(tag),从而形成JSP文件(*.jsp)。
更多“jsp”相关问题
  • 第1题:

    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

  • 第2题:

    WhichJSPstandardactioncanbeusedtoimportcontentfromaresourcecalledfoo.jsp?()

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

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

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

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


    参考答案:C

  • 第3题:

    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

  • 第4题:

    重定向可以使用()方法。

    • A、<forwardpage= “login.jsp”/>
    • B、<jsp:forwardpage= “login.jsp”/>
    • C、request.sendRedirect(“login.jsp”);
    • D、response.sendRedirect(“login.jsp”);

    正确答案:D

  • 第5题:

    在J2EE中,在aa.jsp中有行代码:  <%><%  request.setAttribute("Co.","jb-aptech");  %>  在bb.jsp中有行代码: <%  out.println((String)request.getAttribute("Co."));  %>    <%>   为了使得在bb.jsp中的如上代码可以显示“jb-aptech”,可以使用()方法。

    • A、在aa.jsp中使用<form method=post action="bb.jsp">把请求提交到bb.jsp 
    • B、在aa.jsp中使用<jsp:forward file="bb.jsp" />把页面重定向到bb.jsp  
    • C、在aa.jsp中使用<%  response.sendRedirect("bb.jsp");  %>把页面重定向到bb.jsp 
    • D、在aa.jsp中使用<%@ include file="bb.jsp" %>包含页面bb.jsp  
    • E、在aa.jsp中使用<% config.getServletContext().getRequestDispatcher("/bb.jsp").forward(request,response); %>把页面重定向到bb.jsp

    正确答案:D,E

  • 第6题:

    Which JSP standard action can be used to import content from a resource called foo.jsp?()

    • A、<jsp:import file=’foo.jsp’ />
    • B、<jsp:import page=’foo.jsp’ />
    • C、<jsp:include page=’foo.jsp’ />
    • D、<jsp:include file=’foo.jsp’ />

    正确答案:C

  • 第7题:

    JSP标准动作不包括()。 

    • A、<jsp:forward /> 
    • B、<jsp:forEach /> 
    • C、<jsp:useBean /> 
    • D、<jsp:setProperry /> 

    正确答案:B

  • 第8题:

    下列哪一项不属于JSP动作指令标记?()

    • A、〈jsp:param〉
    • B、〈jsp:plugin〉
    • C、〈jsp:useBean〉
    • D、〈jsp:javaBean〉

    正确答案:D

  • 第9题:

    JSP页面包括以下哪些元素?()

    • A、JSP指令
    • B、JSP Action
    • C、JSP脚本
    • D、JSP控件

    正确答案:A,B,C

  • 第10题:

    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  tag that requires the page name tobe specified dynamically when the header is imported. Which JSP code snippet performs the import of theheader content?() <title>

    • A、<jsp:include page=’/WEB-INF/jsp/header.jsp’><jsp:param name=’pageName’ value=’Welcome Page’ /> </jsp:include>
    • B、<jsp:import page=’/WEB-INF/jsp/header.jsp’><jsp:param name=’pageName’ value=’Welcome Page’ /> </jsp:import>
    • C、<jsp:include page=’/WEB-INF/jsp/header.jsp’><jsp:attribute name=’pageName’ value=’Welcome Page’ /> . </jsp:include>
    • D、<jsp:import page=’/WEB-INF/jsp/header.jsp’>. <jsp:attribute name=’pageName’ value=’Welcome Page’ /> . </jsp:import>

    正确答案:A

  • 第11题:

    单选题
    下面哪个不是JSP中和javabean相关的标记?()
    A

    〈jsp:userBean〉

    B

    〈jsp:include〉

    C

    〈jsp:setProperty〉

    D

    〈jsp:getProperty〉


    正确答案: D
    解析: 暂无解析

  • 第12题:

    单选题
    下列哪一项不属于JSP动作指令标记?()
    A

    〈jsp:param〉

    B

    〈jsp:plugin〉

    C

    〈jsp:useBean〉

    D

    〈jsp:javaBean〉


    正确答案: D
    解析: 暂无解析

  • 第13题:

    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

  • 第14题:

    有三个页面,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

  • 第15题:

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

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

    正确答案:C

  • 第16题:

    JavaBean可以通过相关jsp动作指令进行调用。下面哪个不是JavaBean可以使用的jsp动作指令?()

    • A、〈jsp:useBean〉
    • B、〈jsp:setProperty〉
    • C、〈jsp:getProperty〉
    • D、〈jsp:setParameter〉

    正确答案:D

  • 第17题:

    在J2EE中,对于标记,描述正确的是()。     

    • A、<jsp:param>是<jsp:include>、<jsp:forward>标记的子标记  
    • B、如果aa.jsp有代码:<jsp:forward page="next.jsp"><jsp:param name="name" value="jb-aptech" /></jsp:forward>,则在next.jsp中可以使用request.getParameter("name");把属性name的值取出来 
    • C、如果aa.jsp有代码:<jsp:forward page="next.jsp"><jsp:param name="name" value="jb-aptech" /></jsp:forward>,则在next.jsp中可以使用request.getAttribute("name");把属性name的值取出来 
    • D、如果<jsp:param>标记不放在<jsp:forward>标记内,也就是不作为<jsp:forward>标记的子标记,则使用浏览器查看时会显示错误页面

    正确答案:A,B

  • 第18题:

    在JSP中需要将1.jsp的请求数据通过2.jsp转发给3.jsp,应该在2.jsp中采用()方式实现。

    • A、〈%request.sendRedirect(“3.jsp”)%〉
    • B、〈%response.sendRedirect(“3.jsp”)%〉
    • C、〈%request.getRequestDispatcher(“3.jsp”).forward(request,response)%〉
    • D、〈%response.sentRedirect(“32.jsp”).forward(request,response)%〉

    正确答案:C

  • 第19题:

    用于获取bean属性的动作是()。

    • A、〈jsp:uscBean〉
    • B、〈jsp:getProperty〉
    • C、〈jsp:setProperty〉
    • D、〈jsp:forward〉

    正确答案:B

  • 第20题:

    下面哪个不是JSP中和javabean相关的标记?()

    • A、〈jsp:userBean〉
    • B、〈jsp:include〉
    • C、〈jsp:setProperty〉
    • D、〈jsp:getProperty〉

    正确答案:B

  • 第21题:

    在以下组件中,哪些组件与JavaBean有关?()

    • A、〈jsp:param〉
    • B、〈jsp:setProperty〉
    • C、〈jsp:getProperty〉
    • D、〈jsp:forward〉

    正确答案:B,C

  • 第22题:

    Which two are valid and equivalent?()

    • A、<%! int i; %>
    • B、<%= int i; %>
    • C、<jsp:expr>int i;</jsp:expr>
    • D、<jsp:scriptlet>int i;</jsp:scriptlet>
    • E、<jsp:declaration>int i;</jsp:declaration>

    正确答案:A,E

  • 第23题:

    单选题
    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  tag that requires the page name tobe specified dynamically when the header is imported. Which JSP code snippet performs the import of theheader content?()
    A

    <jsp:include page=’/WEB-INF/jsp/header.jsp’><jsp:param name=’pageName’ value=’Welcome Page’ /> </jsp:include>

    B

    <jsp:import page=’/WEB-INF/jsp/header.jsp’><jsp:param name=’pageName’ value=’Welcome Page’ /> </jsp:import>

    C

    <jsp:include page=’/WEB-INF/jsp/header.jsp’><jsp:attribute name=’pageName’ value=’Welcome Page’ /> . </jsp:include>

    D

    <jsp:import page=’/WEB-INF/jsp/header.jsp’>. <jsp:attribute name=’pageName’ value=’Welcome Page’ /> . </jsp:import>


    正确答案: A
    解析: 暂无解析

  • 第24题:

    单选题
    Your web application views all have the same header, which includes the  tag in the  elementof the rendered HTML. You have decided to remove this redundant HTML code from your JSPs and put itinto a single JSP called /WEB-INF/jsp/header.jsp. However, the title of each page is unique, so you havedecided to use a variable called pageTitle to parameterize this in the header JSP, like this: 10.${param.pageTitle} Which JSP code snippet should you use in your main view JSPs to insert the header and pass thepageTitle variable?()
    A

    <jsp:insert page=’/WEB-INF/jsp/header.jsp’>. ${pageTitle=’Welcome Page’}. </jsp:insert>

    B

    <jsp:include page=’/WEB-INF/jsp/header.jsp’>. ${pageTitle=’Welcome Page’}. </jsp:include>

    C

    <jsp:include file=’/WEB-INF/jsp/header.jsp’>. ${pageTitle=’Welcome Page’}. </jsp:include>

    D

    <jsp:insert page=’/WEB-INF/jsp/header.jsp’>. <jsp:param name=’pageTitle’ value=’Welcome Page’ /> . </jsp:insert>

    E

    <jsp:include page=’/WEB-INF/jsp/header.jsp’>. <jsp:param name=’pageTitle’ value=’Welcome Page’ /> . </jsp:include>


    正确答案: A
    解析: 暂无解析