首页 >> 读书频道 >> 电脑 >> jsp在线考试系统-htm文件
 
· jsp计数器-bean文
· jsp计数器-jsp文件
· 邮件发送简单例子-jsp
· 邮件发送简单例子-htm
· 邮件发送简单例子-bea
· jsp源码实例5(coo
· jsp源码实例4(搜索引
· jsp源码实例3(获取j
· jsp源码实例2(获取表
· jsp源码实例1(输出)
· jsp计数器代码
· 测试你对技术的掌握度:J
 
· 美容养颜手册
· 加油金顺剧情分集介绍完整
· 红楼梦:120回全本[清
· 素质教育在美国
· 全唐诗卷四十六
· 韩剧《布拉格恋人》剧情介
· 夜航船[作者:明·张岱]
· 局外人[作者:韩·可爱淘
· 现场流行病学
· 源氏物语[日本:紫式部]
· 武林寓言故事
· 2006高考录取规则
 
· (出租)中动商场部分及写
· (出租)中动动漫基地&#
· 喜剧学院
· 《善德女王》剧情介绍
· 魔女18号 剧情
· 丑女无敌剧情介绍
· 魔女幼熙剧情介绍
· 龙游天下剧情介绍
· 震撼世界的七日剧情介绍
· 静静的白桦林剧情介绍
· 心情日记—老公今天我想对
· 旗舰剧情介绍
欢迎来到月影社区!如果您觉得这里不错,请推荐给您的朋友们。月影社区:http://wf66.com/

jsp在线考试系统-htm文件


查看有无更新版本

关键字:JSP教程 2006-9-10

 

一个在线考试系统,测试你的jsp知识,代码不是特别多,所以不加注释了(http://jspbbs.yeah.net)

index.jsp

<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD VALIGN="TOP"><FONT FACE="Verdana, Arial, Helvetica, sans-serif">
<DIV ALIGN="RIGHT">
<FONT SIZE="-1"><A HREF="/developer/Quizzes/index.html">Quizzes
Index</A></FONT></DIV>
<H2 ALIGN="RIGHT"><FONT COLOR="#FFFFFFF">JSP Professional, Chapter 12
Quiz</FONT></H2>
<H4 ALIGN="RIGHT"><EM>by Dan Malks</EM></H4>

<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR><TD>
<IMG SRC="penduke.gif" WIDTH="164" HEIGHT="115" ALIGN=left ALT="Duke">
</TD><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif">
The <I><A
HREF="/developer/Books/jsp/index.html">JSP Professional: Chapter 12, JSP
Archictecture</A></I> Test your knowledge on the differences between servlets
and JSP, Factor Forward-Factor Back, page-centric verses the dispatcher
approach, and more.
</FONT></TD></TR>
</TABLE>

<HR>

<!-- Form calls the answer.jsp, which invokes the QuizResponses bean -->
<FORM METHOD="POST" ACTION="answer.jsp">

<OL>
<!-- Question 1 -->

<LI><FONT FACE="Verdana, Arial, Helvetica, sans-serif">Choose the statement
that best describes the relationship between JavaServer
Pages<SUP><FONT SIZE="-2">TM</FONT></SUP> (JSP<SUP><FONT SIZE="-2">TM</FONT></SUP>)
and servlets: </FONT>
<BR>
<TABLE BORDER="0" CELLPADDING="5" CELLSPACING="0">
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="one"
TYPE="RADIO" VALUE="A">  A.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif">
Servlets are built on JSP semantics and all servlets are compiled to JSP
pages for runtime usage<BR></FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="one"
TYPE="RADIO" VALUE="B">  B.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> JSP and servlets are
unrelated technologies</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="one"
TYPE="RADIO" VALUE="C">  C.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif">Servlets and JSP are
competing technologies for handling web requests. Servlets are being superceded
by JSP, which is preferred. The two technologies are not useful in combination.
</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="one"
TYPE="RADIO" VALUE="D">  D.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> JSPs are built on
servlet semantics and all JSPs are compiled to servlets for runtime usage
</FONT></TD></TR>
</TABLE>

<P>
<!-- Question 2 -->
<LI><FONT FACE="Verdana, Arial, Helvetica, sans-serif">What is a benefit of
using JavaBeans<SUP><FONT SIZE="-2">TM</FONT></SUP> to separate business logic
from presentation markup within the JSP environment? </FONT>
<BR>
<TABLE BORDER="0" CELLPADDING="5" CELLSPACING="0">
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="two"
TYPE="RADIO" VALUE="A">  A.</FONT></TD>
<TD>
<FONT FACE="Verdana, Arial, Helvetica, sans-serif"> It allows the JSP to
access middleware </FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="two"
TYPE="RADIO" VALUE="B">  B.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif">It creates a cleaner
role separation between the web-production team and the software development
team, so that the web-production team can focus on presentation markup, while
the software team can focus on building reusable software components for helping
to generate dynamic displays </FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="two"
TYPE="RADIO" VALUE="C">  C.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif">It provides a dynamic
markup environment, such that JavaBeans are integrated seamlessly with the
template presentation content, in order to create the dynamic display for the
client
</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="two"
TYPE="RADIO" VALUE="D">  D.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif">It provides the
developer with full access to the Java<SUP><FONT SIZE="-2">TM</FONT></SUP> 2
Platform Enterprise Edition (J2EE<SUP><FONT SIZE="-2">TM</FONT></SUP>),
which is unavailable from outside the JavaBean environment </FONT></TD></TR>
</TABLE>
<P>
<!-- Question 3 -->

<LI><FONT FACE="Verdana, Arial, Helvetica, sans-serif">Why use the
<CODE>RequestDispatcher</CODE> to forward a request to another resource,
instead of doing a <CODE>sendRedirect</CODE>? </FONT>
<BR>
<TABLE BORDER="0" CELLPADDING="5" CELLSPACING="0">
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="three"
TYPE="RADIO" VALUE="A">  A.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> Redirects are no
longer supported in the current servlet API</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="three"
TYPE="RADIO" VALUE="B">  B.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> Redirects are not a
cross-platform portable mechanism</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="three"
TYPE="RADIO" VALUE="C">  C.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> The <CODE>RequestDispatcher</CODE>
does not use the reflection API</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="three"
TYPE="RADIO" VALUE="D">  D.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> The
<CODE>RequestDispatcher</CODE> does not require a round trip to the client, and
thus is more efficient and allows the server to maintain request
state</FONT></TD></TR>
</TABLE>

<P>
<!-- Question 4 -->

<LI><FONT FACE="Verdana, Arial, Helvetica, sans-serif">What alternatives exist
to embedding Java code directly within the HTML markup of your JSP page?</FONT>
<BR>
<TABLE BORDER="0" CELLPADDING="5" CELLSPACING="0">
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="four"
TYPE="RADIO" VALUE="A">  A.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> Moving the code into
your session manager</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="four"
TYPE="RADIO" VALUE="B">  B.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> Moving the code into
sciptlets</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="four"
TYPE="RADIO" VALUE="C">  C.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> Moving the code into
JavaBeans and servlets</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="four"
TYPE="RADIO" VALUE="D">  D.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> Moving the code into a
transaction manager</FONT></TD></TR>
</TABLE>
<P>
<!-- Question 5 -->

<LI><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> What type of scriptlet
code is better-suited to being <I>factored forward</I> into a servlet?
</FONT>
<BR>
<TABLE BORDER="0" CELLPADDING="5" CELLSPACING="0">
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="five"
TYPE="RADIO" VALUE="A">  A.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif">Code that deals
with logic that is common across requests</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="five"
TYPE="RADIO" VALUE="B">  B.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif">Code that deals
with logic that is vendor specific</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="five"
TYPE="RADIO" VALUE="C">  C.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif">Code that deals
with logic that relates to database access</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="five"
TYPE="RADIO" VALUE="D">  D.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif">Code that deals
with logic that relates to client scope</FONT></TD></TR>
</TABLE>

<P>
<!-- Question 6 -->

<LI><FONT FACE="Verdana, Arial, Helvetica, sans-serif">Choose the statement that
best describes how to connect JSP pages and EJBs</FONT>
<BR>
<TABLE BORDER="0" CELLPADDING="5" CELLSPACING="0">
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="six"
TYPE="RADIO" VALUE="A">  A.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif">Lookup the EJBs from
within a JSP, but use the EJBs from within a basic JavaBean</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="six"
TYPE="RADIO" VALUE="B">  B.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif">Lookup and use the EJBs
from a separate business delegate. The JavaBeans that work with JSP pages are
clients to these business delegates and know nothing about EJB
specifics</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="six"
TYPE="RADIO" VALUE="C">  C.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> Lookup and use the
EJBs from within a JSP page, but only as remote references</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="six"
TYPE="RADIO" VALUE="D">  D.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif">Lookup the EJBs from
within a servlet, delegating usage to specific JSP pages</FONT></TD></TR>
</TABLE>

<P>
<!-- Question 7 -->

<LI><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> Are custom tags
available in JSP 1.0? If not, how else might you implement iteration from
within a JSP? </FONT>
<BR>
<TABLE BORDER="0" CELLPADDING="5" CELLSPACING="0">
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="seven"
TYPE="RADIO" VALUE="A">  A.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> Yes, but the only tags
available relate to database access</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="seven"
TYPE="RADIO" VALUE="B">  B.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> No. To iterate over a
collection of values, one must use scriptlet code</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="seven"
TYPE="RADIO" VALUE="C">  C.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> No, but there is a
standard <iterate> tag that may be used</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="seven"
TYPE="RADIO" VALUE="D">  D.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> Yes, but custom tags
will not help developers create tags for use in iterating over a
collection</FONT></TD></TR>
</TABLE>

<P>
<!-- Question 8 -->

<LI><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> What is the initial
contact point for handling a web request in a <I>Page-Centric</I> architecture?
</FONT>
<BR>
<TABLE BORDER="0" CELLPADDING="5" CELLSPACING="0">
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="eight"
TYPE="RADIO" VALUE= "A">  A.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> A JSP
page</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="eight"
TYPE="RADIO" VALUE= "B">  B.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> A
JavaBean</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="eight"
TYPE="RADIO" VALUE= "C">  C.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> A
servlet</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="eight"
TYPE="RADIO" VALUE= "D">  D.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> A session
manager</FONT></TD></TR>
</TABLE>

<P>
<!-- Question 9 -->

<LI><FONT FACE="Verdana, Arial, Helvetica, sans-serif">What is the difference
between doing an <I>include</I> or a <I>forward</I> with a
<CODE>RequestDispatcher</CODE>?</FONT>
<BR>
<TABLE BORDER="0" CELLPADDING="5" CELLSPACING="0">
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="nine"
TYPE="RADIO" VALUE="A">  A.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> The forward method
transfers control to the designated resource, while the include method invokes
the designated resource, substitutes its output dynamically in the display, and
returns control to the calling page.</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="nine"
TYPE="RADIO" VALUE="B">  B.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> The two methods
provide the same functionality, but with different levels of
persistence</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="nine"
TYPE="RADIO" VALUE="C">  C.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> The forward method is
deprecated as of JSP 1.1 and the include method should be used in order to
substitue portions of a dynamic display at runtime</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="nine"
TYPE="RADIO" VALUE="D">  D.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> The include method
transfers control to a dynamic resource, while the forward method allows for
dynamic substitution of another JPS pages output, returning control to the
calling resource</FONT></TD></TR>
</TABLE>

<P>
<!-- Question 10 -->
<LI><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> What line of code below
might be combined in the same JSP page with a validation guard (for
example,<code> <% bean.validationGuard(); %></code> ), in order to create
an alternate flow of control for scenarios in which exceptions arise. The
<code>validationGaurd</code> method might throw an exception, which should cause
the flow of control to continue in another user-defined page (assume JSP
1.0)</FONT>
<BR>
<TABLE BORDER="0" CELLPADDING="5" CELLSPACING="0">
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="ten"
TYPE="RADIO" VALUE="A">  A.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> <CODE><jsp:error
page="errorPage.jsp" guard="true" /></CODE></FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="ten"
TYPE="RADIO" VALUE="B">  B.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> <CODE><%@ page
language="java" buffer="8k" %></CODE>
</FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="ten"
TYPE="RADIO" VALUE="C">  C.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"> <CODE><jsp:useBean
id="bean" class="examples.Bean" scope="request" /></CODE></FONT></TD></TR>
<TR><TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><INPUT NAME="ten"
TYPE="RADIO" VALUE="D">  D.</FONT></TD>
<TD><FONT FACE="Verdana, Arial, Helvetica, sans-serif"><CODE> <%@ page
language="java" errorPage="errorPage.jsp" buffer="8k"
%></CODE></FONT></TD></TR>
</TABLE>

</OL>

<P>
<DIV ALIGN="CENTER">
<INPUT TYPE="SUBMIT" VALUE="Submit">
<INPUT TYPE="RESET">
</DIV>
</FORM>

</FONT>
</TD>
</TR>
</TABLE>

<P>

jsp在线考试系统-htm文件

[ 1 ]
jsp在线考试系统-htm文件 num

打印本页 关闭

关于我们版权声明本站导航友情连结作品演示 TOP↑