|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
关于第二点:俺问问你,如果是企业级项目的话,诸如RMI,EJB,等一些关键技术,这些难道都不需要学么?如果光是使用jsp,servlet,javabean的话。jsJavaServerPagesFrequentlyAskedQuestions
Maintainer:RichardVowles,rvowles@esperanto.org.nz(http://www.esperanto.org.nz)
Questions
WhatisJSP?
WhatversionisthecurrentversionofJSP?
WherecanIgetthespecificationforJSP?
WhosupportsJSP?
WhatbooksareavailableforJSP?
IsJSPbetterthanASP(MicrosoftsActiveServerPages)?
WhatHTMLeditorssupportJSP?
Yes,buthowdoesitperform?
HowtoinvokeaJSPpagedirectlyfrombybrowser?
HowdoyouinvokeaJSPpagefromaservlet?
Howdoyoupassdata(includingbeans)toaJSPfromaservlet?
HowcanIpoolconnectionstomydatabase?
HowdoIuseotherlanguagesinmyJSP?
HowcanIsetacookieinJSP?
CanJSPandServletsharesameSessionandBeans?
HowdoIplugJSPintoMicrosoftsIISWebServer?
ArethereanynewsgroupsthatdiscussJSP?
Whatdothedifferinglevelsofbeanstorage(page,session,app)mean?
WherecanIfindthemailinglistarchives?
WhataretheimportantstepsinusingJDBCinJSP?
HowdoesvariablescopeworkinJSP?
HowdoIforwardtoanHTMLpage?
ArethereanywhitepapersordocumentsexplaininghowJSPfits?
HowtoIcreatedynamicGIFsformyJSP?
DoyouknowwhereIcouldgetsomecodethatwouldencodesomethingtotheHTMLDTDstandard?
Whatispagecompilation?
HowareservletsandJSPpagesrelated?
AnygoodwebsitesforuptodateactivitiesintheJava/JSP/Servletworld?
HowdoIforceausertologin?
SohowcananewbiegetstartedwithJSP?
HowcanIensurethatsessionobjectsstayinexistencewhenthewebserverrestarts?
HowcanIincludeoneJSPinsideanotherJSP?
Istheresomesortofeventthathappenswhenasessionobjectgetsboundorunboundtothesession?
IsthereawaytoexecuteaJSPfromthecomandlineorfrommyownapplication?
WhatshouldIuse,Model1orModel2?
HowdoIdeleteacookiewithJSP?
AretheretipsonthingstowatchoutforinJSP?
HowdoyougetstartedwithJSPontheMacintosh?
WhatApplicationServerssupportJSP?
WhathappenedtotheLOOPandDISPLAYtagsfromJSP0.92?
DoesJSPhaveabeanprovidingFileUploadfeatureslikeActiveXuploadcontrol?
SohowdoIuseEJBfromJSP?
CanIjustabortprocessingaJSP?
"ImtryingtopassanobjectbetweenaservletandaJSPpage,butmyobjectisnullontheJSPpage.Whatcouldbewrong?"
1)WhatisJSP?TOC
JSPisadynamicscriptingcapabilityforwebpagesthatallowsJavaaswellasafewspecialtagstobeembeddedintoawebfile(HTML/XML,etc).Thesuffixtraditionallyendswith.jsptoindicatetothewebserverthatthefileisaJSPfile.JSPisaserversidetechnology-youcantdoanyclientsidevalidationwithit.
JSPfilesactuallygetcompiledintoServlets,sowhatisthepoint?WhynotjustwriteServlets?
Formostpeople,thebenefitistwofold:
ThefocusisonHTML.JavaandtheJSPextensionsassistinmakingtheHTMLmore
functional.ServletsontheotherhandallowoutputtingofHTMLbutitisatedious
process.
ItiseasytomakeachangeandthenlettheJSPcapabilityoftheWebServeryouare
usingdealwithcompilingitintoaServletandrunningit.
Inthepast,peoplehaveusedservletsbecauseoftheproblemofredirection-becausebythetimetheJSPenginegetsaroundtowritinginformationbackdowntheHTTPpipe,youcouldnotdoaredirecteffectivelyinJSP-leadingtotheconceptsofModel1vsModel2(seequestion38).ThishasbeenfixedinJSP1.0withtheadditionofbufferedoutputstreams.
JavaSoftalsohasaFAQ,coveringdifferentquestions,anditislocatedathttp://java.sun.com/products/jsp/faq.html.
2)WhatversionisthecurrentversionofJSP?TOC
ThecurrentversionofJSPis1.1.Itisavailablefromhttp://java.sun.com/products/jsp.
TheJSP1.1isavailablefromhttp://java.sun.com/products/jsp/techinfo.html.
The0.92specisavailablefromhttp://java.sun.com/products/jsp/jsp092.html
The0.91specisapopularversionthough,andmuchsoftwarethatsupportstheJSPpre-standardactuallysupports0.91ofJSP.
The0.91specisavailablefromhttp://www.burridge.net/jsp/Spec91/jsp_spec.html
3)WherecanIgetthespecificationforJSP?TOC
Youcangetthecurrentspecfromhttp://java.sun.com/products/jsp.Thisisalongwiththereferenceimplementationwhichworkswithitsownwebserver.
4)WhosupportsJSP?TOC
Therearethefollowingimplementationsavailable:
Name
VersionofJSPSupported
Cost
Comments
JSPReference1.1freeTOMCAT-NowincludedaspartoftheJ2EEReferenceImplementation,butalsomanagedbytheJakartaProjectaspartofApache.Thisimplementationhasawaytogobeforebeingreadyforproduction.
GNUJSP1.0free,opensource,locatedinCVSattheGiantJavaTree
SunsJavaWebServer2.01.0commercialSunsownJavaWebServer.BeingreplacedwithiPlanet(Alliance)
PolyJSP0.92free,opensourcePolyJspisbasedonXML/XSLandhasbeendesignedtobeextensible.NowsupportsWebLHasntbeenupdatedforawhile.
Resin1.0,1.1inbetaUnknownNowOpenSource.
SJSP1.1freeforpersonaluseUsescompiletimeintrospection,allowsyoutoreplaceyourexistingJSPengineinyourwebserver.
zJSP0.91Lastupdated,Sept3,1998
JRUN0.92,1.0commercialJSP1.1supportnowinbeta.
Orion1.1commercialOrionisawebapplicationserverthatimplementsJSPinternally.ItalsohasalotofJSPvsotherJSPandvsASPstatsonitspages.AlsosupportsServlet2.2
ServletExec1.1commercialSupportslargenumberofwebservers
RocketJSP1.0GPLLocatedintheGiantJavaTree
5)WhatbooksareavailableforJSP?TOC
TherearenowanumberofbooksavailableonJSPfromvariouspublishers.
AquicksearchofAmazoncomesupwith
ProfessionalJavaServerProgramming:withServlets,JavaServerPages(JSP),XML,EnterpriseJavaBeans(EJB),JNDI,CORBA,JiniandJavaspaces
ProfessionalJavaXMLProgrammingwithservletsandJSP
PureJSPJavaServerPages
WebDevelopmentwithJavaServerPages
ThereisagroupofpeopleworkingonaWebbookforJSP-informationislocatedathttp://www.esperanto.org.nz/jspbook.Thereisanotherathttp://www.aptura.com/technology/jspBook_Architectures.htmlandyetanotheratBrainopolis.
6)IsJSPbetterthanASP(MicrosoftsActiveServerPages)?TOC
Thisisamatterofgreatdebate.ManypuntersthinkthatJavaSofthasthebenefitofhindsight-whatworkswellandwhatdoest.ASPisverycomplexbutsupportsmultiplescriptinglanguagesandtheActiveXmodelofMicrosoft.AlthoughASP_is_availableonmanyplatforms,theActiveXlibrarysupportthatmakesitaspowerfulasitisismissingandthusmakesActiveXonlyfeasibleforanNTplatform.
Accordingtorecentstatistics(seetheRedHatsite),22%ofwebserversareNT,(21%areLinux),thatmeansthereis78%needingsomethingelse,andJSPadvocatesbelievethatJSPfitsthebillnicelythatyouverymuch.
7)WhatHTMLeditorssupportJSP?TOC
MostofthevisualdevelopersdonotsupportJSPinanyway,shapeorform,theymessupthetagstotally.
ThefollowingHTMLeditorshavebeenknowntoworkwithJSP:
Product
Location
Comments
HomeSitehttp://www.allaire.com/JSPcolourcodingwillbeinHS4.0.1,butyoucangetapluginnowfromhttp://www.burridge.net/jsp/homesite.html
NetObjectsScriptBuilder3.0http://www.netobjects.com/products/html/nsb3.htmlWin32productsupportsJSP
Anytexteditor
BorlandJBuilder3.5http://www.borland.com/jbuilderJavaDevelopmenttool,supportsJSPinternally,andallowsrunninganddebuggingofJSPs
Dreamweaver3http://www.dreamweaver.com/IgnoresJSPtags,andallowsyoutoeditJSPfilesasiftheyareHTMLfilesgivenyoucustomisetheproductslightly(youneedtoeditaspecialfile)
FrontPage2000http://www.microsoft.com/frontpageSomereportsthatFrontPagenowignoresJSPtags.
8)Yes,buthowdoesitperform?TOC
Ihavebeenpickingupsomecomments:
BrianBurridge,brian_burridge@VALPAK.COM
"Ourextranetsfor300franchises,500+users,ourIntranetforthousandsofemployees,
andeventuallyallofourotherwebsites.NewAtlantahasbeenrunningfor6weeks
nowwithoutevenoneproblem.ProgramminginJSPhasturnedouttobeaseasyasPerl,
yetallourtestsshowittobeupto10xfaster."
AlsoavailableareasetofbenchmarksfromthepeoplewhomaketheOrionserver,locatedathttp://orion.evermind.net/,andalsofromthepeoplewhodoResin(comparingtheirJSPimplementationwithOrion)
9)HowtoinvokeaJSPpagedirectlyfrombybrowser?TOC
JSPfilesarejustlikeHTMLfiles,soifyourindex.jspfileisinyourrootdirectoryofyourwebsite,usehttp://localhost/index.jsp
net程序员的大部门代码都靠控件拖拽完成的,虽然java也有,但是无论从美观和速度上都没发和.net比。java程序员都是代码完成的,所以java程序员常戏称.net程序员是操作员,呵呵。 |
|