|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
到时我们不用学struts,不用学spring,不用学Hibernate,只要能把jsf学会了,完全可以替代所有的框架,包括AJAX,都知道AJAX并不是新技术,虽说我没深入学习jsf但我认为jsf应该已经能通过其它技术替代AJAX,实现无缝刷新。js|在线
一个在线测验体系,测试你的jsp常识,代码不是出格多,以是不加正文了(http://jspbbs.yeah.net)
index.jsp
<TABLEBORDER="0"CELLPADDING="0"CELLSPACING="0">
<TR>
<TDVALIGN="TOP"><FONTFACE="Verdana,Arial,Helvetica,sans-serif">
<DIVALIGN="RIGHT">
<FONTSIZE="-1"><AHREF="/developer/Quizzes/index.html">Quizzes
Index</A></FONT></DIV>
<H2ALIGN="RIGHT"><FONTCOLOR="#FFFFFFF">JSPProfessional,Chapter12
Quiz</FONT></H2>
<H4ALIGN="RIGHT"><EM>byDanMalks</EM></H4>
<TABLEBORDER="0"CELLPADDING="0"CELLSPACING="0">
<TR><TD>
<IMGSRC=http://www.163design.net/j/jsl/"penduke.gif"WIDTH="164"HEIGHT="115"ALIGN=leftALT="Duke">
</TD><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">
The<I><A
HREF="/developer/Books/jsp/index.html">JSPProfessional:Chapter12,JSP
Archictecture</A></I>Testyourknowledgeonthedifferencesbetweenservlets
andJSP,FactorForward-FactorBack,page-centricversesthedispatcher
approach,andmore.
</FONT></TD></TR>
</TABLE>
<HR>
<!--Formcallstheanswer.jsp,whichinvokestheQuizResponsesbean-->
<FORMMETHOD="POST"ACTION="answer.jsp">
<OL>
<!--Question1-->
<LI><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Choosethestatement
thatbestdescribestherelationshipbetweenJavaServer
Pages<SUP><FONTSIZE="-2">TM</FONT></SUP>(JSP<SUP><FONTSIZE="-2">TM</FONT></SUP>)
andservlets:</FONT>
<BR>
<TABLEBORDER="0"CELLPADDING="5"CELLSPACING="0">
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="one"
TYPE="RADIO"VALUE="A">A.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">
ServletsarebuiltonJSPsemanticsandallservletsarecompiledtoJSP
pagesforruntimeusage<BR></FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="one"
TYPE="RADIO"VALUE="B">B.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">JSPandservletsare
unrelatedtechnologies</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="one"
TYPE="RADIO"VALUE="C">C.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">ServletsandJSPare
competingtechnologiesforhandlingwebrequests.Servletsarebeingsuperceded
byJSP,whichispreferred.Thetwotechnologiesarenotusefulincombination.
</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="one"
TYPE="RADIO"VALUE="D">D.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">JSPsarebuilton
servletsemanticsandallJSPsarecompiledtoservletsforruntimeusage
</FONT></TD></TR>
</TABLE>
<P>
<!--Question2-->
<LI><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Whatisabenefitof
usingJavaBeans<SUP><FONTSIZE="-2">TM</FONT></SUP>toseparatebusinesslogic
frompresentationmarkupwithintheJSPenvironment?</FONT>
<BR>
<TABLEBORDER="0"CELLPADDING="5"CELLSPACING="0">
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="two"
TYPE="RADIO"VALUE="A">A.</FONT></TD>
<TD>
<FONTFACE="Verdana,Arial,Helvetica,sans-serif">ItallowstheJSPto
accessmiddleware</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="two"
TYPE="RADIO"VALUE="B">B.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Itcreatesacleaner
roleseparationbetweentheweb-productionteamandthesoftwaredevelopment
team,sothattheweb-productionteamcanfocusonpresentationmarkup,while
thesoftwareteamcanfocusonbuildingreusablesoftwarecomponentsforhelping
togeneratedynamicdisplays</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="two"
TYPE="RADIO"VALUE="C">C.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Itprovidesadynamic
markupenvironment,suchthatJavaBeansareintegratedseamlesslywiththe
templatepresentationcontent,inordertocreatethedynamicdisplayforthe
client
</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="two"
TYPE="RADIO"VALUE="D">D.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Itprovidesthe
developerwithfullaccesstotheJava<SUP><FONTSIZE="-2">TM</FONT></SUP>2
PlatformEnterpriseEdition(J2EE<SUP><FONTSIZE="-2">TM</FONT></SUP>),
whichisunavailablefromoutsidetheJavaBeanenvironment</FONT></TD></TR>
</TABLE>
<P>
<!--Question3-->
<LI><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Whyusethe
<CODE>RequestDispatcher</CODE>toforwardarequesttoanotherresource,
insteadofdoinga<CODE>sendRedirect</CODE>?</FONT>
<BR>
<TABLEBORDER="0"CELLPADDING="5"CELLSPACING="0">
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="three"
TYPE="RADIO"VALUE="A">A.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Redirectsareno
longersupportedinthecurrentservletAPI</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="three"
TYPE="RADIO"VALUE="B">B.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Redirectsarenota
cross-platformportablemechanism</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="three"
TYPE="RADIO"VALUE="C">C.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">The<CODE>RequestDispatcher</CODE>
doesnotusethereflectionAPI</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="three"
TYPE="RADIO"VALUE="D">D.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">The
<CODE>RequestDispatcher</CODE>doesnotrequirearoundtriptotheclient,and
thusismoreefficientandallowstheservertomaintainrequest
state</FONT></TD></TR>
</TABLE>
<P>
<!--Question4-->
<LI><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Whatalternativesexist
toembeddingJavacodedirectlywithintheHTMLmarkupofyourJSPpage?</FONT>
<BR>
<TABLEBORDER="0"CELLPADDING="5"CELLSPACING="0">
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="four"
TYPE="RADIO"VALUE="A">A.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Movingthecodeinto
yoursessionmanager</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="four"
TYPE="RADIO"VALUE="B">B.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Movingthecodeinto
sciptlets</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="four"
TYPE="RADIO"VALUE="C">C.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Movingthecodeinto
JavaBeansandservlets</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="four"
TYPE="RADIO"VALUE="D">D.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Movingthecodeintoa
transactionmanager</FONT></TD></TR>
</TABLE>
<P>
<!--Question5-->
<LI><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Whattypeofscriptlet
codeisbetter-suitedtobeing<I>factoredforward</I>intoaservlet?
</FONT>
<BR>
<TABLEBORDER="0"CELLPADDING="5"CELLSPACING="0">
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="five"
TYPE="RADIO"VALUE="A">A.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Codethatdeals
withlogicthatiscommonacrossrequests</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="five"
TYPE="RADIO"VALUE="B">B.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Codethatdeals
withlogicthatisvendorspecific</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="five"
TYPE="RADIO"VALUE="C">C.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Codethatdeals
withlogicthatrelatestodatabaseaccess</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="five"
TYPE="RADIO"VALUE="D">D.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Codethatdeals
withlogicthatrelatestoclientscope</FONT></TD></TR>
</TABLE>
<P>
<!--Question6-->
<LI><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Choosethestatementthat
bestdescribeshowtoconnectJSPpagesandEJBs</FONT>
<BR>
<TABLEBORDER="0"CELLPADDING="5"CELLSPACING="0">
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="six"
TYPE="RADIO"VALUE="A">A.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">LookuptheEJBsfrom
withinaJSP,butusetheEJBsfromwithinabasicJavaBean</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="six"
TYPE="RADIO"VALUE="B">B.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">LookupandusetheEJBs
fromaseparatebusinessdelegate.TheJavaBeansthatworkwithJSPpagesare
clientstothesebusinessdelegatesandknownothingaboutEJB
specifics</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="six"
TYPE="RADIO"VALUE="C">C.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Lookupandusethe
EJBsfromwithinaJSPpage,butonlyasremotereferences</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="six"
TYPE="RADIO"VALUE="D">D.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">LookuptheEJBsfrom
withinaservlet,delegatingusagetospecificJSPpages</FONT></TD></TR>
</TABLE>
<P>
<!--Question7-->
<LI><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Arecustomtags
availableinJSP1.0?Ifnot,howelsemightyouimplementiterationfrom
withinaJSP?</FONT>
<BR>
<TABLEBORDER="0"CELLPADDING="5"CELLSPACING="0">
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="seven"
TYPE="RADIO"VALUE="A">A.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Yes,buttheonlytags
availablerelatetodatabaseaccess</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="seven"
TYPE="RADIO"VALUE="B">B.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">No.Toiterateovera
collectionofvalues,onemustusescriptletcode</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="seven"
TYPE="RADIO"VALUE="C">C.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">No,butthereisa
standard<iterate>tagthatmaybeused</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="seven"
TYPE="RADIO"VALUE="D">D.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Yes,butcustomtags
willnothelpdeveloperscreatetagsforuseiniteratingovera
collection</FONT></TD></TR>
</TABLE>
<P>
<!--Question8-->
<LI><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Whatistheinitial
contactpointforhandlingawebrequestina<I>Page-Centric</I>architecture?
</FONT>
<BR>
<TABLEBORDER="0"CELLPADDING="5"CELLSPACING="0">
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="eight"
TYPE="RADIO"VALUE="A">A.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">AJSP
page</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="eight"
TYPE="RADIO"VALUE="B">B.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">A
JavaBean</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="eight"
TYPE="RADIO"VALUE="C">C.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">A
servlet</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="eight"
TYPE="RADIO"VALUE="D">D.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Asession
manager</FONT></TD></TR>
</TABLE>
<P>
<!--Question9-->
<LI><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Whatisthedifference
betweendoingan<I>include</I>ora<I>forward</I>witha
<CODE>RequestDispatcher</CODE>?</FONT>
<BR>
<TABLEBORDER="0"CELLPADDING="5"CELLSPACING="0">
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="nine"
TYPE="RADIO"VALUE="A">A.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Theforwardmethod
transferscontroltothedesignatedresource,whiletheincludemethodinvokes
thedesignatedresource,substitutesitsoutputdynamicallyinthedisplay,and
returnscontroltothecallingpage.</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="nine"
TYPE="RADIO"VALUE="B">B.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Thetwomethods
providethesamefunctionality,butwithdifferentlevelsof
persistence</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="nine"
TYPE="RADIO"VALUE="C">C.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Theforwardmethodis
deprecatedasofJSP1.1andtheincludemethodshouldbeusedinorderto
substitueportionsofadynamicdisplayatruntime</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="nine"
TYPE="RADIO"VALUE="D">D.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Theincludemethod
transferscontroltoadynamicresource,whiletheforwardmethodallowsfor
dynamicsubstitutionofanotherJPSpagesoutput,returningcontroltothe
callingresource</FONT></TD></TR>
</TABLE>
<P>
<!--Question10-->
<LI><FONTFACE="Verdana,Arial,Helvetica,sans-serif">Whatlineofcodebelow
mightbecombinedinthesameJSPpagewithavalidationguard(for
example,<code><%bean.validationGuard();%></code>),inordertocreate
analternateflowofcontrolforscenariosinwhichexceptionsarise.The
<code>validationGaurd</code>methodmightthrowanexception,whichshouldcause
theflowofcontroltocontinueinanotheruser-definedpage(assumeJSP
1.0)</FONT>
<BR>
<TABLEBORDER="0"CELLPADDING="5"CELLSPACING="0">
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="ten"
TYPE="RADIO"VALUE="A">A.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><CODE><jsp:error
page="errorPage.jsp"guard="true"/></CODE></FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="ten"
TYPE="RADIO"VALUE="B">B.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><CODE><%@page
language="java"buffer="8k"%></CODE>
</FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="ten"
TYPE="RADIO"VALUE="C">C.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><CODE><jsp:useBean
id="bean"class="examples.Bean"scope="request"/></CODE></FONT></TD></TR>
<TR><TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><INPUTNAME="ten"
TYPE="RADIO"VALUE="D">D.</FONT></TD>
<TD><FONTFACE="Verdana,Arial,Helvetica,sans-serif"><CODE><%@page
language="java"errorPage="errorPage.jsp"buffer="8k"
%></CODE></FONT></TD></TR>
</TABLE>
</OL>
<P>
<DIVALIGN="CENTER">
<INPUTTYPE="SUBMIT"VALUE="Submit">
<INPUTTYPE="RESET">
</DIV>
</FORM>
</FONT>
</TD>
</TR>
</TABLE>
<P>
Java到底会发战成什么样,让我们拭目以待吧,我始终坚信着java会更好。以上都是俺个人看法,欢迎大家一起交流. |
|