仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 614|回复: 10
打印 上一主题 下一主题

[学习教程] JAVA教程之JSP - FAQ (1)

[复制链接]
变相怪杰 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-1-18 11:27:36 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

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程序员是操作员,呵呵。
飘灵儿 该用户已被删除
沙发
发表于 2015-1-21 07:07:33 | 只看该作者
另外编写和运行Java程序需要JDK(包括JRE),在sun的官方网站上有下载,thinking in java第三版用的JDK版本是1.4,现在流行的版本1.5(sun称作J2SE 5.0,汗),不过听说Bruce的TIJ第四版国外已经出来了,是专门为J2SE 5.0而写的。
分手快乐 该用户已被删除
板凳
发表于 2015-1-22 13:04:49 | 只看该作者
象、泛型编程的特性,广泛应用于企业级Web应用开发和移动应用开发。
深爱那片海 该用户已被删除
地板
发表于 2015-1-25 10:51:44 | 只看该作者
是一种突破用户端机器环境和CPU
金色的骷髅 该用户已被删除
5#
发表于 2015-2-2 21:45:47 | 只看该作者
不过,每次的执行编译后的字节码需要消耗一定的时间,这同时也在一定程度上降低了 Java 程序的运行效率。
简单生活 该用户已被删除
6#
发表于 2015-2-6 09:06:13 | 只看该作者
象、泛型编程的特性,广泛应用于企业级Web应用开发和移动应用开发。
海妖 该用户已被删除
7#
发表于 2015-2-15 20:51:19 | 只看该作者
设计模式是高级程序员真正掌握面向对象核心思想的必修课。设计模式并不是一种具体"技术",它讲述的是思想,它不仅仅展示了接口或抽象类在实际案例中的灵活应用和智慧
不帅 该用户已被删除
8#
发表于 2015-3-4 13:33:20 | 只看该作者
是一种将安全性(Security)列为第一优先考虑的语言
小妖女 该用户已被删除
9#
发表于 2015-3-11 19:42:48 | 只看该作者
你现在最缺的是实际的工作经验,而不是书本上那些凭空想出来的程序。
再见西城 该用户已被删除
10#
发表于 2015-3-19 10:24:10 | 只看该作者
应用在电视机、电话、闹钟、烤面包机等家用电器的控制和通信。由于这些智能化家电的市场需求没有预期的高,Sun公司放弃了该项计划。随着1990年代互联网的发展
柔情似水 该用户已被删除
11#
发表于 2015-3-27 17:12:19 | 只看该作者
如果你学过HTML,那么事情要好办的多,如果没有,那你快去补一补HTML基础吧。其实JSP中的Java语法也不多,它更象一个脚本语言,有点象ASP。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-11-15 13:49

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表