JSP开发Web站点的主要方式有:直接JSP、JSP+JavaBean、JSP+JavaBean+Servlet、______________和SSH。
第1题:
Yourwebapplicationviewsallhavethesameheader,whichincludesthe<title>taginthe<head>elementoftherenderedHTML.YouhavedecidedtoremovethisredundantHTMLcodefromyourJSPsandputitintoasingleJSPcalled/WEB-INF/jsp/header.jsp.However,thetitleofeachpageisunique,soyouhavedecidedtouseavariablecalledpageTitletoparameterizethisintheheaderJSP,likethis:
10.<title>${param.pageTitle}<title>
WhichJSPcodesnippetshouldyouuseinyourmainviewJSPstoinserttheheaderandpassthepageTitlevariable?()
第2题:
有两个页面a.jsp和b.jsp,要从a.jsp传值到b.jsp有几种方法?分别是什么?
a:最常用的方法是用form中的text,<input type=text name=username value=admin>,然后在b.jsp页面中这样获取
String username=request.getParameter("username");
b:直接在Url地址栏里面输入第一个页面的地址,在后加问号,然后把要传的参数及值写在后面,如有多个用&隔开,然后在下一页面用
request.getParameter("参数名")来获取,在b.jsp中可用这样获取:String username=request.getParameter("username");String username=request.getParameter("password");
c:在form中放hidden,如:<input type=hidden name=username value=admin>,获取方法同上
说明:传值的方法有很多种,以上是最常用最简单的几种方式,当然,如果传的值有中文的话,需另做处理
第3题:
第4题:
以下选项中()不是开发JSP应用程序所必需的。
第5题:
Web开发技术中的客户端技术有()。
第6题:
JSP+JavaBean模式,这种模式通常称为“Model1模式。
第7题:
下列对于JSP说法中正确的是()
第8题:
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
第9题:
对
错
第10题:
对
错
第11题:
<jsp:include page=’/WEB-INF/jsp/header.jsp’><jsp:param name=’pageName’ value=’Welcome Page’ /> </jsp:include>
<jsp:import page=’/WEB-INF/jsp/header.jsp’><jsp:param name=’pageName’ value=’Welcome Page’ /> </jsp:import>
<jsp:include page=’/WEB-INF/jsp/header.jsp’><jsp:attribute name=’pageName’ value=’Welcome Page’ /> . </jsp:include>
<jsp:import page=’/WEB-INF/jsp/header.jsp’>. <jsp:attribute name=’pageName’ value=’Welcome Page’ /> . </jsp:import>
第12题:
<jsp:insert page=’/WEB-INF/jsp/header.jsp’>. ${pageTitle=’Welcome Page’}. </jsp:insert>
<jsp:include page=’/WEB-INF/jsp/header.jsp’>. ${pageTitle=’Welcome Page’}. </jsp:include>
<jsp:include file=’/WEB-INF/jsp/header.jsp’>. ${pageTitle=’Welcome Page’}. </jsp:include>
<jsp:insert page=’/WEB-INF/jsp/header.jsp’>. <jsp:param name=’pageTitle’ value=’Welcome Page’ /> . </jsp:insert>
<jsp:include page=’/WEB-INF/jsp/header.jsp’>. <jsp:param name=’pageTitle’ value=’Welcome Page’ /> . </jsp:include>
第13题:
YouarebuildingJSPpagesthathaveasetofmenusthatarevisiblebasedonauser’ssecurityrole.Thesemenusarehand-craftedbyyourwebdesignteam;forexample,theSalesManagerrolehasamenuinthefile/WEB-INF/html/sales-mgr-menu.html.WhichJSPcodesnippetshouldbeusedtomakethismenuvisibletotheuser?()
A.<%if(request.isUserInRole("SalesManager")){%><%@includefile=’/WEB-INF/html/sales-mgr-menu.html’%><%}%>
B.<jsp:iftest=’request.isUserInRole("SalesManager")’><%@includefile=’/WEB-INF/html/sales-mgr-menu.html’%></jsp:if>
C.<%if(request.isUserInRole("SalesManager")){%>.<jsp:includefile=’/WEB-INF/html/sales-mgr-menu.html’/>.<%}%>
D.<jsp:iftest=’request.isUserInRole("SalesManager")’><jsp:includefile=’/WEB-INF/html/sales-mgr-menu.html’/></jsp:if>
第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题:
目前JavaBeans和JSP技术是Web应用服务器三层结构中的中间层业务逻辑开发的主要工具。
第16题:
关于JSP的论述,正确的有()
第17题:
To take advantage of the capabilities of modern browsers that use web standards, such as XHTML andCSS, your web application is being converted from simple JSP pages to JSP Document format. However,one of your JSPs, /scripts/screenFunctions.jsp, generates a JavaScript file. This file is included in severalweb forms to create screen-specific validation functions and are included in these pages with the followingstatement: 10. 11.
第18题:
在JSP中,若要在JSP正确使用标签:
第19题:
JSP开发网站的两种模式分为jsp+javabean和jsp+javabean+servlet。
第20题:
You are building JSP pages that have a set of menus that are visible based on a user’s security role. Thesemenus are hand-crafted by your web design team; for example, the SalesManager role has a menu in thefile /WEB-INF/html/sales-mgr-menu.html. Which JSP code snippet should be used to make this menuvisible to the user?()
第21题:
对
错
第22题:
<c:import url=foo.jsp/>
<c:import page=foo.jsp/>
<c:include url=foo.jsp/>
<c:include page=foo.jsp/>
第23题:
<% if ( request.isUserInRole(SalesManager) ) { %> <%@ include file=’/WEB-INF/html/sales-mgr-menu.html’ %> <% } %>
<jsp:if test=’request.isUserInRole(SalesManager)’> <%@ include file=’/WEB-INF/html/sales-mgr-menu.html’ %> </jsp:if>
<% if ( request.isUserInRole(SalesManager) ) { %> . <jsp:include file=’/WEB-INF/html/sales-mgr-menu.html’ /> . <% } %>
<jsp:if test=’request.isUserInRole(SalesManager)’> <jsp:include file=’/WEB-INF/html/sales-mgr-menu.html’ /> </jsp:if>
第24题:
public.class.AddAction.implements.Action{...extends.Action
mapping.findForward(/ch01/result.jsp);findForward(“name”),new.ActionForward(“/ch01/result.jsp”)
form.method=getaction=add.do
action.name=addActionpath=/addtype=y2ssh.sg.web.action.AddActionName指form的名字