使用动作元素,将 no10 项目下面的 public 文件夹中的 header.jsp 包含到 index.jsp 文件中。请问在 index.jsp 文件中实现上述功能的动作元素代码书写正确的是( )
A: <;jsp:include page="header.jsp" />;
B: <;jsp:include page="/public/header.jsp" />;
C: <;jsp:include page="/no10/public/index.jsp" />;
D: <;jsp:include file="/public/header.jsp" />;
A: <;jsp:include page="header.jsp" />;
B: <;jsp:include page="/public/header.jsp" />;
C: <;jsp:include page="/no10/public/index.jsp" />;
D: <;jsp:include file="/public/header.jsp" />;
举一反三
- Your web application views all have the same header, which includes the <title> tag in the <head> 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.<title>${param.pageTitle}<title> 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>
- 在JSP文件中加载动态页面不能用()指令。 A: include命令 B: jsp:include动作 C: page D: jsp:forward动作
- 在JSP文件中加载动态页面可以用指令( )。 A: <;%@ include file="filename" %>; B: <;jsp:include/>; C: page指令 D: <;jsp:forward/>;指令
- 下面关于动态包含的语法格式,书写正确的是( ) A: <;jsp:include file=”relativeURL” />; B: <;jsp:include path=”relativeURL” />; C: <;jsp:include page=”relativeURL” />; D: <;%@include file=”relativeURL” />;
- 下面关于动态包含的语法格式,书写正确的是( ) A: <%@include file=”relativeURL”/> B: <jsp:forward page=”relativeURL”/> C: <jsp:forward file=”relativeURL” /> D: <jsp:include page=”relativeURL”/>