您的位置:首页网页设计JSP实例 → jsp在线考试系统-htm文件

jsp在线考试系统-htm文件

时间:2004/11/7 3:38:00来源:本站整理作者:蓝点我要评论(0)

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



index.jsp













Quizzes

Index



JSP Professional, Chapter 12

Quiz



by Dan Malks













The <A

HREF="/developer/Books/jsp/index.html">JSP Professional: Chapter 12, JSP

Archictecture Test your knowledge on the differences between servlets

and JSP, Factor Forward-Factor Back, page-centric verses the dispatcher

approach, and more.















Choose the statement

that best describes the relationship between JavaServer

PagesTM (JSPTM)

and servlets:




















<INPUT NAME="one"

TYPE="RADIO" VALUE="A"> &nbsp;A.


Servlets are built on JSP semantics and all servlets are compiled to JSP

pages for runtime usage

<INPUT NAME="one"

TYPE="RADIO" VALUE="B"> &nbsp;B.
JSP and servlets are

unrelated technologies
<INPUT NAME="one"

TYPE="RADIO" VALUE="C"> &nbsp;C.
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.


<INPUT NAME="one"

TYPE="RADIO" VALUE="D"> &nbsp;D.
JSPs are built on

servlet semantics and all JSPs are compiled to servlets for runtime usage








What is a benefit of

using JavaBeansTM to separate business logic

from presentation markup within the JSP environment?




















<INPUT NAME="two"

TYPE="RADIO" VALUE="A"> &nbsp;A.


It allows the JSP to

access middleware
<INPUT NAME="two"

TYPE="RADIO" VALUE="B"> &nbsp;B.
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
<INPUT NAME="two"

TYPE="RADIO" VALUE="C"> &nbsp;C.
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


<INPUT NAME="two"

TYPE="RADIO" VALUE="D"> &nbsp;D.
It provides the

developer with full access to the JavaTM 2

Platform Enterprise Edition (J2EETM),

which is unavailable from outside the JavaBean environment







Why use the

RequestDispatcher to forward a request to another resource,

instead of doing a sendRedirect?




















<INPUT NAME="three"

TYPE="RADIO" VALUE="A"> &nbsp;A.
Redirects are no

longer supported in the current servlet API
<INPUT NAME="three"

TYPE="RADIO" VALUE="B"> &nbsp;B.
Redirects are not a

cross-platform portable mechanism
<INPUT NAME="three"

TYPE="RADIO" VALUE="C"> &nbsp;C.
The RequestDispatcher

does not use the reflection API
<INPUT NAME="three"

TYPE="RADIO" VALUE="D"> &nbsp;D.
The

RequestDispatcher does not require a round trip to the client, and

thus is more efficient and allows the server to maintain request

state









What alternatives exist

to embedding Java code directly within the HTML markup of your JSP page?




















<INPUT NAME="four"

TYPE="RADIO" VALUE="A"> &nbsp;A.
Moving the code into

your session manager
<INPUT NAME="four"

TYPE="RADIO" VALUE="B"> &nbsp;B.
Moving the code into

sciptlets
<INPUT NAME="four"

TYPE="RADIO" VALUE="C"> &nbsp;C.
Moving the code into

JavaBeans and servlets
<INPUT NAME="four"

TYPE="RADIO" VALUE="D"> &nbsp;D.
Moving the code into a

transaction manager







What type of scriptlet

code is better-suited to being factored forward into a servlet?






















<INPUT NAME="five"

TYPE="RADIO" VALUE="A"> &nbsp;A.
Code that deals

with logic that is common across requests
<INPUT NAME="five"

TYPE="RADIO" VALUE="B"> &nbsp;B.
Code that deals

with logic that is vendor specific
<INPUT NAME="five"

TYPE="RADIO" VALUE="C"> &nbsp;C.
Code that deals

with logic that relates to database access
<INPUT NAME="five"

TYPE="RADIO" VALUE="D"> &nbsp;D.
Code that deals

with logic that relates to client scope









Choose the statement that

best describes how to connect JSP pages and EJBs




















<INPUT NAME="six"

TYPE="RADIO" VALUE="A"> &nbsp;A.
Lookup the EJBs from

within a JSP, but use the EJBs from within a basic JavaBean
<INPUT NAME="six"

TYPE="RADIO" VALUE="B"> &nbsp;B.
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
<INPUT NAME="six"

TYPE="RADIO" VALUE="C"> &nbsp;C.
Lookup and use the

EJBs from within a JSP page, but only as remote references
<INPUT NAME="six"

TYPE="RADIO" VALUE="D"> &nbsp;D.
Lookup the EJBs from

within a servlet, delegating usage to specific JSP pages









Are custom tags

available in JSP 1.0? If not, how else might you implement iteration from

within a JSP?




















<INPUT NAME="seven"

TYPE="RADIO" VALUE="A"> &nbsp;A.
Yes, but the only tags

available relate to database access
<INPUT NAME="seven"

TYPE="RADIO" VALUE="B"> &nbsp;B.
No. To iterate over a

collection of values, one must use scriptlet code
<INPUT NAME="seven"

TYPE="RADIO" VALUE="C"> &nbsp;C.
No, but there is a

standard &lt;iterate&gt; tag that may be used
<INPUT NAME="seven"

TYPE="RADIO" VALUE="D"> &nbsp;D.
Yes, but custom tags

will not help developers create tags for use in iterating over a

collection









What is the initial

contact point for handling a web request in a Page-Centric architecture?






















<INPUT NAME="eight"

TYPE="RADIO" VALUE= "A"> &nbsp;A.
A JSP

page
<INPUT NAME="eight"

TYPE="RADIO" VALUE= "B"> &nbsp;B.
A

JavaBean
<INPUT NAME="eight"

TYPE="RADIO" VALUE= "C"> &nbsp;C.
A

servlet
<INPUT NAME="eight"

TYPE="RADIO" VALUE= "D"> &nbsp;D.
A session

manager









What is the difference

between doing an include or a forward with a

RequestDispatcher?




















<INPUT NAME="nine"

TYPE="RADIO" VALUE="A"> &nbsp;A.
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.
<INPUT NAME="nine"

TYPE="RADIO" VALUE="B"> &nbsp;B.
The two methods

provide the functionality, but with different levels of

persistence
<INPUT NAME="nine"

TYPE="RADIO" VALUE="C"> &nbsp;C.
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
<INPUT NAME="nine"

TYPE="RADIO" VALUE="D"> &nbsp;D.
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







What line of code below

might be combined in the JSP page with a validation guard (for

example, &lt;% bean.validationGuard(); %&gt; ), in order to create

an alternate flow of control for scenarios in which exceptions arise. The

validationGaurd method might throw an exception, which should cause

the flow of control to continue in another user-defined page (assume JSP

1.0)




















<INPUT NAME="ten"

TYPE="RADIO" VALUE="A"> &nbsp;A.
&lt;jsp:error

page="errorPage.jsp" guard="true" /&gt;
<INPUT NAME="ten"

TYPE="RADIO" VALUE="B"> &nbsp;B.
&lt;%@ page

language="java" buffer="8k" %&gt;


<INPUT NAME="ten"

TYPE="RADIO" VALUE="C"> &nbsp;C.
&lt;jsp:useBean

id="bean" class="examples.Bean" scope="request" /&gt;
<INPUT NAME="ten"

TYPE="RADIO" VALUE="D"> &nbsp;D.
&lt;%@ page

language="java" errorPage="errorPage.jsp" buffer="8k"

%&gt;





























相关阅读 Windows错误代码大全 Windows错误代码查询激活windows有什么用Mac QQ和Windows QQ聊天记录怎么合并 Mac QQ和Windows QQ聊天记录Windows 10自动更新怎么关闭 如何关闭Windows 10自动更新windows 10 rs4快速预览版17017下载错误问题Win10秋季创意者更新16291更新了什么 win10 16291更新内容windows10秋季创意者更新时间 windows10秋季创意者更新内容kb3150513补丁更新了什么 Windows 10补丁kb3150513是什么

文章评论
发表评论

热门文章 没有查询到任何记录。

最新文章 没有查询到任何记录。 学习java必学的几门技术jspSmartUpload上传下载全攻略Tomcat5.x中的虚拟主机配置方法利用iText在JSP中生成PDF报表

人气排行 告诉大家JSP连接数据库程序代码JSP单页面网站文件管理器jsp留言板源代码一: 给jsp初学者.在jsp中用bean和servlet联合实现用户注册、使用JSP + JAVABEAN + XML 开发的一个例子jsp在线考试系统-jsp文件 jsp计数器代码JSP/JAVABEAN+TOMCAT4.0.5+MYSQL组合建站总