html jsp在线考试系统,jsp在线考试系统-jsp文件

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

answer.jsp

, leaving HTML to be easily --%>

int missed = 10 - score;

double grade = (double)score/10*100;

%>Quizzes

Index

JSP Professional, Chapter 12 Quiz

Answers

by Dan Malks

1.D

is correct!is incorrect!Blank XEvery JavaServer PagesTM

(JSP)TMsource page is compiled into

a servlet before it is executed at runtime.

2.B

is correct!is

incorrectBlank

XWhen large amounts of Java scriptlet code are mixed with HTML markup

within a JSP page, not only do readability and reuse suffer, but often

bugs are introduced as web-production team members, who may not be

familiar with Java programming, need to modify the accompanying markup.

Additionally, dependencies now exist among various teams competing for the

file, making the development process less efficient.

3.D

is correct!is

incorrectBlank XDoing an HTTP redirect requires a round-trip to the client. If this

is not required, and the only desire is to forward the request to

another resource, then this can be much more efficiently accomplished

with the RequestDispatcher. Additionally, when using the

dispatcher the state of the request object is maintained between

resources, which will not be the case with the HTTP redirect.

4.C

is correct!is

incorrectBlank XBusiness logic is better contained in a

JavaBeanTM or a servlet, which is

owned by a software developer. When lots of Java code is embedded

directly within the JSP page as scriptlets, the

"cut-and-paste" mentality tends to prevail when it comes

to code reuse.

5.Ais correct!is

incorrectBlank XSince the servlet is the initial contact point for each request, it is

well-suited to handle logic that is common across multiple requests.

A good example of this type of logic is an authentication check.

6.Bis correct!is

incorrectBlank XUsing a business delegate reduces coupling between the presentation

and business tiers. The presentation tier has no knowledge of the

EJB implementation details, such as Java Naming and Directory

InterfaceTM lookup.

7.Bis correct!is

incorrectBlank XUsing Java scriptlets is the accepted method of doing iteration in

JSPTM 1.0. In

JSPTM 1.1, a custom tag may be used,

which will hide the implementation details of the iteration code.

8.Ais correct!is

incorrectBlank

XThe term Page-Centric is used to describe an architecture where

the initial contact point for the request is a JSP page. An example

is shown visually below:

9.Ais correct!is

incorrectBlank XWhen the forward method is used, the invoking resource does not regain

control. Multiple include invocations can be made from the

resource, while the invoking resource maintains execution control.

10.Dis correct!is

incorrectBlank XError pages are invoked when there is an uncaught exception from

within a particular page. In this case, we mention that the

validationGaurd() method might throw an exception.

If this exception is not caught within the page, then we vector

control to the errorPage, as stipulated in the attribute

of the given page directive.

You missed

Your score ispercent.

Source Code

This quiz used the Page-View with Bean Approach, detailed in

HREF="/developer/Books/javaserverpages/">Chapter 12, JSP Archeticure. The first

page of the quiz consists of regular HTML with a form that calls

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值