在jsp程序中使用Http响应头信息Refresh,实现3秒后自动跳转到当前Web应用内的相对路径welcome.jsp页面,语句正确的是。
A: esponse.Refresh="3;url=welcome.jsp";
B: esponse.setRefresh("3;url=welcome.jsp");
C: http.setHeader("Refresh","3;url=welcome.jsp");
D: esponse.setHeader("Refresh","3;url=welcome.jsp");
A: esponse.Refresh="3;url=welcome.jsp";
B: esponse.setRefresh("3;url=welcome.jsp");
C: http.setHeader("Refresh","3;url=welcome.jsp");
D: esponse.setHeader("Refresh","3;url=welcome.jsp");
举一反三
- 在JSP页面中,以下forward标准动作的语法正确的是() A: <jsp:forwardparam="url"/> B: <jsp:forwardfile="url"/> C: <jsp:forwardurl="url"/> D: <jsp:forwardpage="url"/>
- 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: equest . sendRedirect(“http://www.hncu.net”); B: equest . sendRedirect(); C: esponse . sendRedirect(“http://www.hncu.net”); D: esponse .sendRedirect();
- 在login.jsp页面输入登录名和密码后,将登录名和密码等信息存储在session对象中,然后跳转到welcome.jsp页面,在welcome.jsp页面显示登录名。 注意:如果在login.jsp页面输入的登录名不为空,才能跳转到welcome.jsp页面。
- 中国大学MOOC: 在JSP页面中,如果从一个源页面中通过<jsp:forward page=url/>将本页面请求转发至指定URL组件,则在该URL组件(JSP页面)中不可以处理的共享数据范围是 ( )。