|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
进而能拉拢大多数程序员用windows产品。并且从ASP.NETAJAX可以跨平台这一点上,间接证明了我们的推断,至少证明了微软做过这方面的研究。所以如果哪一天突然听说了.net可以跨平台了,那么请不要吃惊,如果这一天真的到来,java就到了真正和.net决战的时刻。因为不到万不得以的时候微软是不会推出跨平台的.net的,如果跨平台的.net还不足以对抗java的话,那么微软还剩的手段就是开源了,呵呵。
入手下手温习的是080。
看了几位先辈的帖子,才晓得081和080有很年夜的分歧。
以下为增添的两部分,为EL和JSTL。
Chapter7.BuildingJSPPagesUsingtheExpressionLanguage(EL)
Givenascenario(计划;情形;提要),writeELcodethataccessesthefollowingimplicitvariablesincluding:pageScope,requestScope,sessionScope,andapplicationScope,paramandparamValues,headerandheaderValues,cookie,initParamandpageContext.
ThereareseveralimplicitobjectsthatareavailabletoELexpressionsusedinJSPpages.Theseobjectsarealwaysavailableunderthesenames(讲的是EL的隐含对象和复杂的申明)
然后举了几个例子,有EL的.运算和[]运算。
Chapter9.BuildingJSPPagesUsingTagLibrariesForacustomtaglibraryoralibraryofTagFiles,createthetaglibdirectiveforaJSPpage.
Thesetofsignificant(成心义的,严重的,主要的)tagsaJSPcontainerinterprets(注释,申明)canbeextendedthroughataglibrary.
ThetaglibdirectiveinaJSPpagedeclaresthatthepageusesataglibrary,uniquely(共同地,独一地,珍异地)identifiesthetaglibraryusingaURIandassociates(使产生接洽,使团结)atagprefixthatwilldistinguishusageoftheactionsinthelibrary.
IfaJSPcontainerimplementationcannotlocateataglibrarydescription,afataltranslationerrorshallresult.
Itisafataltranslationerrorforthetaglibdirectivetoappearafteractionsorfunctionsusingtheprefix.
Inthefollowingexample,ataglibraryisintroducedandmadeavailabletothispageusingthesuperprefix;noothertaglibrariesshouldbeintroducedinthispageusingthisprefix.Inthisparticularcase,weassumethetaglibraryincludesadoMagicelementtype,whichisusedwithinthepage.
JSTL增添的部分:
Givenadesigngoal,useanappropriate(得当的)JSPStandardTagLibrary(JSTLv1.1)tagfromthe"core"taglibrary.
ThecenterofJSTListhecoretaglib.Thiscanbesplitintofiveareas:
Generalpurpose
Variablessupport
Conditional
Iterator
URLRelated
Tousethecorelibrary,usethefollowingdirective:
<%@taglibprefix="c"uri="http://java.sun.com/jstl/core"%>Theprefixattributespecifies(指定,划定,断定)theprefixusedinthetagnameforaparticularlibrary.Forexample,thecorelibraryincludesatagnamedout.Whencombinedwithaprefixofc,thefulltagwouldbe<c:out>.Youarefreetouseanyprefixyoulike,butyoumustusedifferentprefixesforeachofthefourstandardtaglibraries.
Youmustalsoputthecorresponding(响应的).tldfileforeachtaglibraryinyour/WEB-INFdirectoryandusethetaglibelementinyourweb.xmlfiletoincludethetaglibrary:
<taglib><taglib-uri>http://java.sun.com/jstl/core</taglib-uri><taglib-location>/WEB-INF/tld/core.tld</taglib-location></taglib>
Generalpurposetags.
Thegeneral-purposetagsletyoudisplayvariablevalues,andenclose(关闭,密封;包装,包抄)agroupoftagswithinatry-catchblock.
The<c:out>actionprovidesacapability(才能,功能,容量)similartoJSPexpressionssuchas<%=scripting-language-expression%>or${el-expression}.Forexample:
Youhave<c:outvalue="${sessionScope.user.itemCount}"/>items.
The<c:catch>actionallowspageauthorstohandleerrorsfromanyactioninauniform(一致的,不异的)fashion,andallowsforerrorhandlingformultipleactionsatonce.<c:catch>providespageauthorswithgranular(粒度[状)errorhandling:Actionsthatareofcentralimportancetoapageshouldnotbeencapsulated(密封)ina<c:catch>,sotheirexceptionswillpropagatetoanerrorpage,whereasactionswithsecondaryimportancetothepageshouldbewrappedina<c:catch>,sotheynevercausetheerrorpagemechanismtobeinvoked(挪用).Theexceptionthrownisstoredinthescopedvariableidentifiedbyvar,whichalwayshaspagescope.Ifnoexceptionoccurred,thescopedvariableidentifiedbyvarisremovedifitexisted.Ifvarismissing,theexceptionissimplycaughtandnotsaved.
<c:catch[var="varName"]>nested(嵌套的)actions</c:catch>这部分基础上触及了JSTL的一切内容。
包含<c:out><c:set><c:catch><c:when><c:choose><c:remove><c:forTokens><c:forEach><c:if>
另有<c:url><c:import><c:redirect>
具体内容见http://java.boot.by/wcd-guide/ch09s03.html
学习JAVA的目的更多的是培养自身的工作能力,我觉得工作能力的一个核心就是:独立思考能力,因为只有独立思考后,才会有自己的见解 |
|