




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
JSP簡 JSP的九大內(nèi)置對 JSP指 JSP的組 企業(yè)級可擴(kuò)展性的JavaBean技 簡 Struts的說 概 重要 簡 Hibernate架 持久化對象及集 瞬態(tài)和分離對象和集 事 連接提供 事務(wù)工 Hibernate配 hibernate配置文 hibernate屬性文 可編程配 建立一個 獲得session實(shí) JSPJSPJSP(JavaServerPages)SunMicrosystems公司發(fā)起,與許多公司參與建立的一種頁技術(shù)標(biāo)準(zhǔn)。JSP是一種結(jié)合了跨平臺與跨服務(wù)器機(jī)制,以Java為主的技術(shù)來產(chǎn)生頁。JSP技術(shù)有點(diǎn)類似ASP技術(shù),但它是使用類似HTML以及Java代碼片段而不是VBScriptHTML文件(*HTM,*html)中Java程序段和JSP標(biāo)記(),從而形成JSP文件(*.jsp中。當(dāng)你所使用的服務(wù)器沒有為ASP提供本地支持,也就是Apache或Netscape服務(wù)器時,你可以考慮使用JSPASP附加配備程序的服務(wù)器,但價格相當(dāng)昂貴,而目前SunJSPSolaris與Linux以及Windows。另外請不要將JSP與服務(wù)器端的JavaScript混為一談服務(wù)器會自動將以JSP寫成的JavaJavaservlets。而許多先前必須以手寫的Perl程式或服務(wù)器API(ASP)JSP來自動化處理。。JSP技術(shù)為創(chuàng)建顯示內(nèi)容動態(tài)生成的網(wǎng)頁提供了一個簡單,快速的方法。JSP技術(shù)的設(shè)計(jì)使基于Web結(jié)構(gòu)的應(yīng)用程序更容易和并且可以將這些應(yīng)用程序與各種WebWebJSP開發(fā)是跨平臺的,可以運(yùn)行在Linux上,也可用于其他操作系統(tǒng)。JSP技術(shù)通過XML標(biāo)記和使用Java編程語言,來產(chǎn)生頁包處理邏輯。頁面還和存在服務(wù)器中的邏輯資源JSP邏輯與網(wǎng)頁即設(shè)計(jì)和顯示分離,Web的應(yīng)用開發(fā)變的迅速和容易。使用JSP技術(shù),Web頁面開發(fā)可以使用HTML或者XML標(biāo)識來設(shè)計(jì)和格式封裝在標(biāo)識和JavaBeans組件和在一個小的,在服務(wù)器端運(yùn)行的所有。如夠編輯和使用JSP頁面,而不影響內(nèi)容的生成。)(XML)頁面的形式發(fā)回給瀏覽器。這有助于作者保護(hù)自己的代碼,并確保任何HTMLWeb瀏覽器的完全可用性。中的HTML代碼的實(shí)現(xiàn)與結(jié)果返回給庫的Java編程操作可以被重新導(dǎo)向的以便實(shí)現(xiàn)建立功能所需要的動態(tài)頁面JSP和JavaServlet在服務(wù)器端執(zhí)行的,通常返回給客戶端的HTML文本,只要在客戶端瀏覽器就能。jsp頁面是JspWeb服務(wù)器或應(yīng)用程序的引擎使用jspJSP引擎接受客戶端請求,并生成jspjsp頁面通常編譯后成為JavaServlet的。后者是一種標(biāo)準(zhǔn)的Java擴(kuò)展在站點(diǎn)有更詳細(xì)的描述。網(wǎng)頁開發(fā)可以通過所有的Java應(yīng)用環(huán)境以利用Java當(dāng)?shù)谝粋€jspJavaServlet的類,并且JSPJSP頁面可以使用不同的協(xié)議。Web的客戶端可以直接進(jìn)行JavaServletJSPjsp頁面從動態(tài)內(nèi)容該對象,并將結(jié)果(HTML)發(fā)送回瀏覽器。此方法創(chuàng)建多個應(yīng)用程序可重復(fù)使用的組件和應(yīng)用程序之間共享可以用作一個更存在。jp(vansvBnTM組件)絕大多數(shù)實(shí)行的應(yīng)用更復(fù)雜的處理要求。開發(fā)能夠共享和交換組件來執(zhí)行常見操,Web頁面開發(fā)不熟悉編程的語言。JavaServer頁面技術(shù)封裝了許多功能,JSPXML標(biāo)識中的動態(tài)內(nèi)容生成需要使用。jsp的標(biāo)識標(biāo)準(zhǔn),可以訪問和實(shí)例化JavaBeans組件,設(shè)置或檢索的屬性組件的Applet,以及執(zhí)行用其他,通過庫的發(fā)展,jsp技術(shù)可以擴(kuò)展。今后,第開發(fā)和其他為了常用的功能來創(chuàng)建自己的標(biāo)識庫。這使得Web頁面開發(fā)能夠使用熟悉的工具和相同JSP技術(shù)很容易整合到多種應(yīng)用體系結(jié)構(gòu),充分利用現(xiàn)有的工具和技術(shù)優(yōu)勢,并擴(kuò)Java技術(shù)作為家庭從Java2(企業(yè)架構(gòu))JSPWeb由于內(nèi)置語言jsp頁面是基于Java編程語言的,所有的JSP頁面都被編譯成JavaServlet的,JSP頁面上有Java技術(shù)的所有好處,包括健壯的管理和安全性作為Java平臺的一部分,JSP擁有Java編程語言“一次編寫,到處運(yùn)行”的特點(diǎn)。隨著越來越多的供應(yīng)商將被添加到JSP支持自己的產(chǎn)品,你可以用你自己的選擇的服務(wù)當(dāng)與Java2平臺企業(yè)版(J2EE)JavaBeanJSP頁面將提供企Web的應(yīng)用程序的部署是必不JSP1.0199991.1規(guī)范。目前較新的是JSP1.2規(guī)范,JSP2.0規(guī)范的征求也已出臺。request,response,out,session,application,config,pagecontext,page,exception標(biāo)用戶的包的對象可以這些信息ResponseSession(1)會話:session對象是一個內(nèi)置對象的JSP,它在第一個JSP頁面加載session對象。(2)session對象ID:當(dāng)客戶第一次在JSP頁面的服務(wù)器端,JSP引擎產(chǎn)生一IDJSPStringID他頁面的服務(wù)器,客戶不再分配給新的會話對象,直到關(guān)閉瀏覽器,客戶端-服務(wù)器aplicationout目標(biāo):outJSPjspJSPJSP引擎。這包括:相關(guān)信息傳輸頁面,如緩沖區(qū)和線程信息或誤治的jsp頁面指令,語言指令指定的語言,以及所有的擴(kuò)展。-JSP頁面應(yīng)該更JSP文件。標(biāo)識庫的說明,該頁面可以調(diào)用客戶端標(biāo)識庫JSPjspJSPXMLJSP1.0中包含大jsp:useBeanJavaBeans的組件實(shí)例的useBean的如果組件實(shí)例不存在JavaBeans組件實(shí)例化和商標(biāo)jspsetPropertyjsp:getProperty的這個標(biāo)識來獲得屬性值的組件實(shí)例,將被轉(zhuǎn)換成字符串,并把戶標(biāo)識庫的開發(fā),使得工具的供應(yīng)商或其他可以要求一個特定的任務(wù)來創(chuàng)建和標(biāo)志。jsp頁面中包含一個小的頁面,被稱為小(scriptlet的)。小是一個中的<%和%>標(biāo)志已被描述。標(biāo)志在本作所有的事情都描述的語言引擎實(shí)現(xiàn),在的例子是Java虛擬機(jī)的主機(jī)JSP規(guī)范支持所有常用的組件,包括正則表達(dá)式和語句JSP頁面由HTML代碼和嵌入在其中一個組件的Java代碼組成該服務(wù)器是在Java代碼后,客戶端請求的頁面,然后將生成的HTML頁面返回給客戶端的瀏覽器。JavaServlet是JSP的技術(shù)基礎(chǔ)和JavaServlet和JSPWeb應(yīng)用程序開發(fā)的需求來完成。JSP與Java技術(shù)的簡單易用,完全面象,和平臺無關(guān),安全,主要面向上網(wǎng)JSPJavaPHP更好,除了系統(tǒng),代碼沒有做任ASP/PHP的局限性是顯而易見的。強(qiáng)大的可擴(kuò)展性。從只有一個小的Jar文件可以運(yùn)行的Servlet/JSP,到多臺服的服務(wù)器,Java顯示了一個巨大的生命力。ASPJava的已經(jīng)有很多很好的JSP和ASP一樣Java的一些優(yōu)點(diǎn)也是其致命的問題正是由于為了跨平臺的功能,數(shù)量確實(shí)是“最低性能價格比。另一方面,它也需要磁盤空間來一系列的.java文件和.class,以及文件的相應(yīng)版本。JSP頁面可以作為企業(yè)JavaBean(EJB)體系結(jié)構(gòu),一個中間層。在這種情況下,通過EJB組件的JSP頁面和后端資源交互。商務(wù)或其他應(yīng)用程序,EJB管理交易和潛在的安全。這將簡化JSP頁面。該模型適用于Java2企業(yè)版(J2EE)平臺的支持。JSPXMLHTMLXML,開發(fā)人員可以包括jsp頁面的XML標(biāo)識和靜態(tài)模板的一部分。動態(tài)XML生成,使用基于服務(wù)XML客戶端標(biāo)識符。JSP頁面的XML工具也不會太大。雖然當(dāng)JSP頁面JSP使得即使手工創(chuàng)作者的設(shè)計(jì)規(guī)范也很容易,JSP規(guī)范還提供了一種機(jī)制,以便創(chuàng)造一個任意jspXML版本。通過這種方式,XML工具能夠創(chuàng)建和運(yùn)行JSP頁面。由JSP轉(zhuǎn)換的標(biāo)志和部件與等價的xml兼容,你可以使用XML為基礎(chǔ)的工具來操作的JSP頁面例如可以被包含在<%和%>中或基于XML的標(biāo)志<jsp:scriptlet>和</jsp的:的scriptlet>中。事實(shí)上,以下幾個簡單的jspXML頁面jspxml和兼容其他對象;對于其他組件(通常非JSP)頁面創(chuàng)建一個CDATA元素;XMLHTMLWebXMLJSP頁面和兼容的服務(wù)器和JSP集成到一起工作。JSP以使用JSP頁面來創(chuàng)建可移植的Web應(yīng)用程序,在不同的Web和應(yīng)用服務(wù)器,面對不通過與行業(yè)合作,SUN保證JSP規(guī)范是開放的和可移植可以使用任何客戶端JSP規(guī)范1.0版的路徑通過第一步的開放的工業(yè)標(biāo)準(zhǔn)方法生成動態(tài)Web頁面。1.0版本通過一個標(biāo)識集,隱含對象,并開始創(chuàng)建動態(tài)Web頁面構(gòu)成的方法所需要的Web服務(wù)器,應(yīng)用服務(wù)器和開發(fā)工具供應(yīng)商正在加入到他們的產(chǎn)品JSP1.0的支持,使該行業(yè)已經(jīng)具備了初始的即時支持。1999.1L2EE集成和該版本的擴(kuò)展和供應(yīng)商可以選擇擴(kuò)展和擴(kuò)展jp基,必要的功能。SP引擎能夠支持多種功能強(qiáng)大的語言和對象模型在行業(yè)拓展的技術(shù)能力和使用SP同時,Sun公司還承諾將保證SP平臺和服務(wù)器技術(shù),以保持固有的可移植性。Struts可以被定義為是基于請求和使用以開發(fā)Java企業(yè)版(JavaEE)Web應(yīng)用WebStruts框架是一個模型-視圖-控制器(MVC)的框架,并通過使用MVCStruts的web框架被稱為基于WebStruts2JavaWeb應(yīng)用程序,器。MVC中的模型是負(fù)責(zé)業(yè)務(wù)邏輯和數(shù)據(jù)相關(guān)的工作,該模型還對視圖和控制器一無所知。MVC中的視圖負(fù)責(zé),顯示相關(guān)的工作,通過成功地模型的getters給出了模型。視圖不知道控制器。當(dāng)模型發(fā)生變化,視圖必須被通知。MVC中的控制器基的請求,并分別發(fā)送響應(yīng)給客戶端。在模型中的其他體系結(jié)構(gòu)中,ServletJava服務(wù)器頁面都被使用,并且使用這種方式,分別服務(wù)于動態(tài)內(nèi)容。在Struts中的版本的MVC模式由五部分組成,分別包括動作或模型,器,值棧和開放式圖形導(dǎo)航語,(OGNL,結(jié)果和結(jié)果類型,視圖技術(shù)。Struts的版本和MVC框架不同,在這個Struts2中,動作在模型的工作形式,不是如上面了在傳統(tǒng)的MVC模式的控制器。的struts框架的功能包括普通Java對象(POJO)的形式和POJO操作的,支持,異步JavaScript和XML(AJAX)的支持下,不同的框架如Hibernate,Spring度Servlet過濾器和器用來實(shí)現(xiàn)控制。模式使用動作實(shí)施工作。視圖得到了包括結(jié)OGNLStruts框架是基于Java服務(wù)器頁面(JSP)JavaservletStruts框架建議在整個應(yīng)用程序連續(xù)使用MVC設(shè)計(jì)模式。在此方式中,生命周期根據(jù)用戶工作的請求;Servlet結(jié)果分別發(fā)送到用戶的響應(yīng)。在Struts2中可用的有不同的類型和這些包括控制,數(shù)據(jù),表單和AJAX。在Struts2中的分別以<s:formaction="">及</s:form>形式表示。在Struts2中幫簽和其他許多。Struts2中數(shù)據(jù)幫助數(shù)據(jù)及頁面上的工作數(shù)據(jù)顯示。一些數(shù)據(jù)URI,文本和其他許多。Struts2中的表單選擇,組合框等等。同樣,在Struts2中Ajax也可以像數(shù)據(jù),控制和表單。調(diào)用的變化從s到SxAjax中所做的工作。XML里面的。MVC設(shè)計(jì)模式的重要性是在一個應(yīng)用程序分離各部分的工作,并以使代碼可Web應(yīng)用程序。開發(fā)XML文檔文件的詳MVC結(jié)合在一起的。Struts的主要目標(biāo)是分離模型相關(guān)的工作,其中包含應(yīng)用程序的邏輯處理數(shù)據(jù)庫系統(tǒng)及相關(guān)工作,在視圖里面以HTML的形式顯Hibernate是一個對象關(guān)系(ORM)工具。對象關(guān)系或ORM是一種編程方法將對象到關(guān)系模型,實(shí)體類到表、實(shí)例到行和實(shí)例的屬性到列的表。Hibernate持久性框架,從Java環(huán)境中保存數(shù)據(jù)到數(shù)據(jù)庫中。持久性是一個數(shù)據(jù)到媒介和檢索它甚至回到任何應(yīng)用程序創(chuàng)建了數(shù)據(jù)結(jié)束后時間點(diǎn)的過程。Hibernate的體系結(jié)構(gòu)。它會創(chuàng)建一個數(shù)據(jù)庫和應(yīng)用程序之間的層。它加載配置細(xì)節(jié)像數(shù)據(jù)庫連接字符串,實(shí)體類、等。Hibernate創(chuàng)建持久對象,上面的圖表顯示了Hibernate的一個全面的體系結(jié)構(gòu)。為了保存數(shù)據(jù)到數(shù)據(jù)們還沒有和Session聯(lián)系或沒有保存到數(shù)據(jù)庫中。為了持久化對象數(shù)據(jù)庫,應(yīng)該創(chuàng)建SessionFactory接口的實(shí)例。SessionFactory是一個單例實(shí)例,實(shí)現(xiàn)了工廠設(shè)計(jì)模式。SessionFactory加載hibernate.cfg.xml文件(Hibernate配置文件。細(xì)節(jié)在以下部分)和借助TransactionFactoryConnectionProvider實(shí)現(xiàn)數(shù)據(jù)庫上的所有配置設(shè)置。HibernateSession接口實(shí)例化來創(chuàng)建。Session代表一個與數(shù)據(jù)庫的連接。從SessionFactory對象創(chuàng)建Session對象。Hibernate還提供內(nèi)置的事務(wù)apiJDBC應(yīng)用程序進(jìn)行了抽象或JTA事務(wù)。每一個線程安全的,不可變的緩存編譯的一個數(shù)據(jù)庫。org.hibernate.session實(shí)例工廠。org.hibernate.connection.ConnectionProvider的客戶??梢砸粋€二級緩存的數(shù)據(jù)一個單線程的,短暫的對象代表一個應(yīng)用程序和持久性之間的。包裝JDBCjava.sql.Connection。工廠org.hibernate.Transaction。一個持久的一級緩存應(yīng)用程序短暫的單線程對象包含持久狀態(tài)和業(yè)務(wù)功能。這些可以是javabean/pojo。他們用一個org.hibernate.Sessionorg.hibernate.session關(guān)閉時,他們將被分離和org.hibernate.Session不相關(guān)。他們可能被應(yīng)用程序?qū)嵗?沒有持久,或者他們可能已經(jīng)實(shí)例化封閉的org.hibernate.Session。況下交易。然而,事務(wù)界定,API或org.hibernate。事務(wù),從來不是可選的。(可選)的工廠,和BC連接池。它從底層javx.ql抽象應(yīng)用程序。數(shù)據(jù)源或jav.ql.riverngr。它沒有公開給應(yīng)用程序,但是它可以擴(kuò)展和/或由開發(fā)來實(shí)現(xiàn)。(可選)org.hibernate工廠,事務(wù)實(shí)例。這不是給應(yīng)用程序,但它可以擴(kuò)展和/或由Hibernate配置由org.hibernate.cfg.Configuration的實(shí)例管理。.cfg.Configuration代表一組完整的應(yīng)用程序的Java類型的到一個SQL數(shù)據(jù)庫org.hibernate.cfg.Configuration用于構(gòu)建一個不變的Factory。是編譯從各種XML文件或Java5注釋Hibernatehibernate.cfg.xmlxmlhibernate配置和駐留在應(yīng)用程序pertieshibernateJava兼容屬性文件持可編程配置—這是手工的方法。配置可以在Javahibernatehibernate。hibernate.cfg.xmlxml文件,一旦hibernate.cfg.xml文件被創(chuàng)建并放置在應(yīng)用程序的類路徑的根,HibernateAPI sessionFactory=newConfiguration().configure().上面的代碼將加載默認(rèn)hibernate.cfg。xmlxml,APISessionFactorysf注意:hibernate.cfg.xmlHperties文件可以同時在一個應(yīng)用程序提供。在這種情況下hibernate.cfg。xml被優(yōu)先于perties。hibernateHperties,并將其放在應(yīng)可以獲得org.hibernate.cfg.ConfigurationXML文件。如果文件在類路徑中,使用addResource()。例如Configurationcfg另法是指定類,讓Hibernate為你找到文檔:Configurationcfg=newConfiguration()Hibernate將搜索文件命名/net/viralpa/hibernate/employee.hbm.xml和/org.hibernate.cfg.Configuration一旦org.hibernate.cfg的實(shí)創(chuàng)建使用上面的任何方法,可以創(chuàng)建SessionFactory的單例SessionFactorysessions=Hibernateorg.hibernate.SessionFactory。這是有用的,如果務(wù)??梢詣?chuàng)建會話從SessionFactory如下:Sessionsession=sessions.openSession();//getanew因此,在本文中,看到了一個HibernateORM及其體系結(jié)構(gòu)的概述。也注意到不同的組件,如SessionFactoryTransactionFactory、session等以及在應(yīng)用程序中實(shí)例化這些對象的api。IntroductionofJSP 1.1 JSP JSP Script JavaBeantechnologyusingenterprise-classscalability JSPpagewiththexmltechnology JSPtechnology's Descriptionof SessionFactory Session Persistentobjectsand Transientanddetachedobjectsand Transaction TransactionFactory Hibernate Programmatic Buildinga GettingSession IntroductionofJSPJSP(JavaServerPages)isinitiatedbySunMicrosystems,Inc.,withmanycompaniestoparticipateintheestablishmentofadynamicwebpagetechnicalstandards.JSPisacombinationofcross-platformandcross-siteservermechanismtoJava-basedtechnologytoproducedynamicwges.JSPtechnologysomewhatsimilartoASPtechnology,ButitistheuseofHTML-liketagsandJavacodesnippetsinsteadofVBScript.itisinthetraditionalHTMLwge(*.htm,*.html)toinserttheJavaprogrammingparagraphandJSPtag(tag),thusJSPs(*.jsp).WhenthewebserveryouareusingdoesnotprovidelocalsupportforASP,whichisApacheorNetscapeserver,youcanconsiderusingJSP.AlthoughyoucangettheseserverswithASPadditionalprocedures,butthepriceisquiteexpensive,butSundoesnotcurrentlychargeforwhatyouwantJSPcomponents.ForSolarisandLinuxaswellasWindows,thesecomponentsarealsoveryeasytoobtain.Also,donotconfusedJSPandserver-sideJavaScript.JSPwebserverautomaticallywillbewritteninJavacodefragmentisconvertedintoJavaservlets.ManypreviouslymustbehandwrittenPerlprogramorserver-specificAPI(suchasASP)controlfeaturesarealsoavailablethroughtheJSPtoautomateprocessing.JSPtechnologyforthecreationofdisplaycontentdynamicallygeneratedWebpageprovidesasimpleandrapidmethod.Jsptechnologyisdesignedtoenablestructure-basedWebapplicationsmoreeasilyandfaster,andcantheseapplicationswithavarietyofWebservers,applicationservers,browsers,anddevelopmenttoolstoworktogether.UsingJSPdevelopmentoftheWebapplicationiscross-platformthatcanrunonLinux,isalsoavailableforotheroperatingsystems.JSPtechnologytousetheJavaprogramminglanguagepreparedbythecategoryofXMLtagsandscriptlets,toproducedynamicpagespackageprocessinglogic.Pagealsovisitbytagsandscriptletsexistintheserviceeoftheresourcesoflogic.JSPpagelogicandwebpage,designanddisplayseparation,supportreusablecomponent-baseddesign,Web-basedapplicationdevelopmentisrapidandeasy.Usingjsptechnology,WebpagedeveloperscanuseHTMLorxmllogotodesignandformattingthefinalpage.Jsplogoortheuseofboundfeetwouldhavetogeneratedynamiccontentonthepage.Thelogic-generatedcontenthasbeenpackagedinalogoandcomponentsandtiedupinasmallscript,allthescriptsintheserver-siderun.IfthecorelogicwasencapsulatedinthelogoandBeans,thenotherpeople,suchasmanagementandWebpagedesigners,caneditandusejsppages,withoutaffectingterationofcontent.Theserverside,jspengineexplainedjsplogoandsmallscripttogeneratethecontent(forexample,byaccessingJavaBeanscomponents,theuseoftechnologyJDBCTMaccessthedatabase,orincludefile),andtheresultstoHTML(orxml)pageoftheformsentbacktothebrowser.Thishelpstheauthortoprotecttheircode,andensurethatanyHTML-basedWebbrowsercompleyavailability.WebserverinthefaceofvisitsJSPpagerequest,theimplementationofproceduresof,andthentogetherwiththeresultsoftheimplementationofJSPsinHTMLcodewiththereturntothecustomer.InserttheJavaprogrammingoperationofthedatabasecanbere-orientedwebsites,inordertoachievetheestablishmentofdynamicpagesneededtofunction.JSPandJavaServlet,isintheimplementationoftheserver,usuallyreturnedtotheclientisanHTMLtext,aslongastheclientbrowserwillbeabletovisit.Jsppagefromtheimplementationofjspengine,enginesinstalledintheWebserverorapplicationusingjspserver.jspenginetoaccepttheclientrequesttothejsppage,andgeneratejsppagestotheclient'sresponse.Jsppagesareusuallycompiled eaJavaServlet.ThelatterisastandardJavaextensionin sitehasmoredetaileddescription.PagedeveloperscanaccessalloftheJavaapplicationenvironmenttotakeadvantageofJavatechnology,scalabilityandportability.Whenthejsppageiscalled,ifitdoesnotexist,willbecompiledintoaJavaServletcategory,andisstoredintheserver'smemory.Thismakesthenextcalltothepagehaveaveryquickresponse.Jsppagecanbeincludedinawidevarietyofapplicationarchitectureormodel.jsppagecanbeusedbydifferentprotocols.Inanotherpossibleconfiguration,Web-basedclientmaybedirectlyontheJavaServletrequests,Servlettogeneratedynamiccontent,theresultstiedtoaresultsobjectandcalljsppage.jsppagetoaccesstheobjectfromthedynamiccontent,andtheresults(suchasHTML)sentbacktothebrowser.Thismethodtocreatemoreapplicationscanbesharedbetweenreusablecomponentsandapplicationscanbeusedaspartofabiggercompleted.However,inthesamedealwithdatabasessuchasEnterpriseResourceConnection,thescalabilityproblemstillexists.Jsppagereliesonthevastmajorityofreusable,cross-platformcomponents(JavaBeansorEnterpriseJavaBeansTMcomponents)toimplementtherequirementsofapplicationsmorecomplextreatment.Developerstobeabletoshareandexchangecomponentstoperformcommonoperations,ormakethesecomponentsmoreuserorclientgroupstouse.Component-basedapproachtoacceleratetheoveralldevelopmentprocess,andmakeavarietyoforganizationsintheirexistingskillsandtooptimizetheresultsofdevelopmenteffortsinthebalance.Webpagedevelopersarenotfamiliarwiththescriptinglanguageoftheprogrammer.JavaServerPagetechnologypackagesanumberoffunctions,whichareinusewiththejsp-relatedxmllogoindynamiccontentgenerationneeds.JsplogostandardscanaccessandinstantiateJavaBeanscomponents,setorretrievecomponentsofproperty,downloadApplet,andimplementationbyothermeansmoredifficulttoencodeandtime-consumingfunction.Throughthedevelopmentofcustomizedlogoslibrary,jsptechnologycanbeextended.Infuture,third-partydevelopersandothernelforcommonlyusedfeaturestocreateyourownlogolibrary.ThisallowsWgedeveloperscanusefamiliartoolsandthesamelogoastheimplementationofspecificfunctionsofcomponentstowork.Jsptechnologyeasilyintegratedintoavarietyofapplicationsarchitecture,totakeadvantageofexistingtoolsandtechniques,andexpandedtobeabletosupportenterprise-classdistributedapplications.TheuseofJavatechnologyaspartofthefamily,aswellastheJava2(EnterpriseArchitecture)isanintegralpartof,jsptechnologycansupportthehighlycomplexWeb-basedapplications.Jsppagebecauseofthebuilt-scriptinglanguageisbasedontheJavaprogramminglanguage,andallthejsppagesarecompiledto eJavaServlet,jsppageonwithallthebenefitsofJavatechnology,includingrobuststoragemanagementandsecurity.AspartofJavaPlatform,jsphasaJavaprogramminglanguage,"writeonce,runeverywhere"characteristics.Asmoreandmorerswillbeaddedtojspsupporttheirproducts,youcanuseyourownchoiceofserverandtools,changetools,ortheserverdoesnotaffectthecurrentapplication.WhenusedwithJava2Platform,EnterpriseEdition(J2EE)andEnterpriseJavaBeantechnologyintegration,jsppagewillprovideenterprise-classscalabilityandperformance,whichisessentialforthedeploymentofvirtualenterpriseWeb-basedapplicationsisessential.JSP1.0specificationofthefinalversionislaunchedinSeptember1999,Decemberhasintroduced1.1specifications.AtpresentrelativelynewisJSP1.2norms,JSP2.0normsofdrafthasalsobeenJSPninebuilt-inrequest,response,out,session,application,config,pagecontext,page,Requestobject:Theobjectofthepackageofinformationsubmittedbyusers,bycallingtheobjectcorrespondingwaytoaccesstheinformationpackage,namelytheuseoftheuserscanaccesstheinformation.Responseobject:Thecustomer'srequestdynamicresponsetotheclientthesessionWhatisthesession:sessionobjectisabuilt-inobjectsJSP,itintheJSPpagesloadedautomaticallycreate,completetheconversationofmanagement.Fromacustomertoopenabrowserandconnecttotheserver,toclosethebrowser,leavingofthisserver,knownasaconversation.Whenacustomervisitsaserver,theservermaybeafewpageslinkbetweenrepeatedly,repeatedlyrefreshapage,theservershouldbethroughsomekindofwaytoknowthisisthesameclient,whichrequiressessionsessionobjectID:Whenacustomer'svisittoaserverontheJSPpages,JSPenginesproduceasessionobject,andassignedaStringtypeofIDnumber,JSPengineatthesametime,theIDnumbersenttotheclient,storedin,thissessionobjects,andcustomersontheestablishmentofaone-to-onerelationship.Whenacustomertoconnecttotheserveroftheotherpages,customersnolongerallocatedtothenewsessionobject,until,closeyourbrowser,theclient-serverobjecttocancelthesession,andtheconversation,andcustomerrelationshipdisappeared.Whenacustomerre-openthebrowsertoconnecttotheserver,theserverforthecustomertocreateanewsessionobject.aplication:Servershavelaunchedaftertheapplicationobject,whenacustomertovisitthesitebetweenthevariouspageshere,thisapplicationobjectsarethesame,untiltheserverisdown.Butwiththesessiondifferenceisthatallcustomersoftheapplicationobjectsarethesame,thatis,allcustomerssharethisbuilt-inapplicationobjects.outs:outasaoutputflow,usedtoclientoutputdata.outsfortheoutputdata.JSPjsppageusingjspdirectinstructiondeliveredtothejspengine.Thisjsppagedirectivesrelatedtoinformationtransmissionpage,suchasbufferandinformationorwrongLanguageinstructionsspecifiedscriptinglanguage,aswellasalltheContainsinstructionscanbeusedinthepagethatcontainsanexternal.Agoodexampleisthecopyrightorcompanyinformationss-inacentralizedlocationtopreservetheandthepagecontainsmorethaninalljsppageshouldbeeasiertoupdate.Ofcourse,beingcontainedinamayalsobeanotherjspfile.LogolibraryinstructionspointedoutthatthepagecancallaclientlogoJSPWilldealwiththeoverwhelmingmajorityofjspandjsprelatedxmlbasedonthecompletionofthelogo.jsp1.0containssubstantialstandardlogo,whichidentifiesasacoreidentity,including:jsp:useBeanstatementoftheidentityofacomponentinstanceoftheuseofJavaBeans.Ifthecomponentinstancedoesnotexist,JavaBeanscomponentstoinstantiateandregisterthejsp:setPropertythislogosetupexamplesofcomponentsofaproperty'svalue.jsp:getPropertythislogotoobtainacomponentinstanceofthepropertyvalue,willtranslatedintoastring,andplaceitimpliedobject"out"jsp:includeyoucanincludetheoutputofaservletinaJSPusingthejsp.include<jsp:includepage="/servlet/itso.servjsp.servletapi.SHTMLServlet"jsp:forwardyoucanforwardprocessingfromaJSPtoaservletusingthejsp.forwardtag:<jsp:forwardpage="/servlet/itso.servjsp.servletapi.SHTMLServlet"/>Themeritoftheirlogointheapplicationeasytouseandshare.Grammarbasedonthelogooftherealpowercomesfromthecustomeridentificationlibrarydevelopment,makesatoolrorothernelcanrequestaspecificassignmenttocreateandlogo.ScriptJsppageinthepagethatcontainsasmallscript,calledthesmallscript(scriptlets).Smallscriptisacodefragment,intherequestprocessingisexecuted.Smallscriptscanbeastaticpageelement(asthesameastheaboveexample)tocreatedynamicallygeneratedpages.Scriptinthe<%and%>signshavebeendescribed.Signsinthisforallthethingsaredescribedscriptinglanguageengineimplementation,inourcasearethehostoftheJavaVirtualMachineJspspecificationsupportallcommonlyusedscriptcomponent,includingexpressionsandJSPpagesfromHTMLcodeandJavacodeembeddedinoneofthecomponents.TheserverwasinthepagesofclientrequestsaftertheJavacodeandthenwillgeneratetheHTMLpagestoreturntotheclientbrowser.JavaServletJSPisthetechnicalfoundationandlarge-scaleWebapplicationdevelopmentneedsofJavaServletandJSPsupporttocomplete.JSPwiththeJavatechnologyeasytouse,fullyobject-oriented,andaplatform-independentandsecure,mainlyforallthecharacteristicsoftheInternet.JSPtechnologystrengthWriteonce,runeverywhere.AtthispointJavabetterthanPHP,inadditiontosystems,thecodenottomakeanychanges.themulti-platformsupport.Basicallyonallplatformsofanydevelopmentenvironment,inanyenvironmentfordeploymentinanyenvironmentintheexpansion.ComparedASP/PHPlimitationsareobvious.astrongscalability.FromonlyasmallJarscanrunServlet/JSP,tothemultipleserversclusteringandloadbalancing,tomultipleApplicationfortransactionprocessing,informationprocessing,aservertonumerousservers,Javashowsatremendousdiversificationandpowerfuldevelopmenttoolssupport.ThisissimilartotheASP,Javaalreadyhavemanyverygooddevelopmenttools,andmanycanbefree,andmanyofthemhavebeenabletorunonavarietyofplatformsunder.JSPtechnologyvulnerableandthesameASP,Javaistheadvantageofsomeofitsfatalproblem.Itispreciselybecauseinordertocross-platformfunctionality,inordertoextremestretchingcapacity,greatlyincreasingthecomplexityoftheproduct.Java'sspeedisclasstocompletethepermanentmemory,soinsomecasesbytheuseofmemorycomparedtothenumberofusersisindeeda"minimumcostperformance."Ontheotherhand,italsoneedsdiskspacetostoreaseriesof.Javasand.Class,aswellasthecorrespondingversionsofs.JavaBeantechnologyusingenterprise-classscalabilityjsppagecanbeusedasEnterpriseJavaBean(EJB)architecture,amiddlelayer.Inthiscase,jsppagesandtheback-endresourcesthroughEJBcomponentsinteract.EJBcomponentsontheback-endmanagementofresourcestovisit,soasalargenumberofconcurrentuserswithscalableperformance.For merceorotherapplications,EJBmanagementtransactionsandpotentialsafety.Thiswillsimplifythejsppage.ThemodelfortheJava2EnterpriseEdition(J2EE)platformsupport.JSPpagewiththexmltechnologyjsppagecanbeusedtogeneratethexmlandtheHTMLpage.Forasimplexmlgenerated,developerscanincludejsppagexmllogoandpartofthestatictemplate.Dynamicxmlgeneration,theuseofserver-basedobjectsandgeneratetheoutputxmlclientidentifier.jsppagewiththexmltoolsarenot patible.AlthoughtheSuninthedesignspecificationwhenjsppagejspmakesevenmanualforcreatorsisalsoveryeasy,jspspecificationalsoprovidesamechanismtofacilitatethecreationofanarbitraryjsppagexmlversion.Inthisway,xmltooltobeabletocreateandoperatejsppage.Byjspconvertlogoandcomponentscompatiblewiththexmlequivalent,youcanusexml-basedtoolstooperatethejsppage.Forexample,thescriptcanbeincludedinthe<%and%>in,orbasedonthexmllogo<jsp:scriptlet>and</jsp:scriptlet>Medium.Infact,afterfollowingafewsimplejsppagewillbeconvertedtoxmlpagesarepossible,thesestepsinclude:Addingarooement ponentsandinstructionswillbeconvertedtoxmlandotherobjectsofcompatible,Forpageinothercomponents(usuallynon-jsp)createaCDATAThroughthismethodcompatiblewiththexml,createHTMLpagedesignersstillhavearapidlycreatedynamicWebpages-to-useenvironment,meanwhile,xml-basedtoolsandservicescanbeintegratedwiththejsppageandcompatibleserverandjsptoworktogether.JSPtechnology'sJsptechnologyhasbeendesignedasanopen,scalabledynamicWebpagesetupstandards.DeveloperscanusejsppagetocreateaportableWebapplications,indifferentWebandapplicationserversforthedifferentoccasionsarerunning,andwhatevertheoccasionitselfandtheneedforthecreationoftools.Throughcooperationwithleadersoftheindustry,Sunassurancejspnormsareopenandcanbetransplanted.Canuseanyclientandserverplatforms,inanyplacetoprepareanddeploythem.Thefuture,toolsrsandothervendorswillbeprovidedforthespecializedfunctionoftheclientlogolibrarytoexpandtheplatformfunctionality.Jspspecificationversion1.0isthepathtothedynamicWgegeneratedbyanindustrystandardmethodofthestep.Version1.0throughacorelogosets,implicitobjects,andtostartcreatingdynamicWgesconstitutesthebasicfunctionsrequiredofthemethodisbasic.AlreadyhasanumberofWebservers,applicationserveranddevelopmenttoolvendorsareaddingtotheirproductsjsp1.0support,sothattheindustryalreadyhastheinitial,immediatesupport.Willbecompletedlaterin1999the1.1versionofthexmlthroughgreatersupportforidentificationofcustomers,aswellasintegrationwithJ2EEandtheexpansionofthisversion.Andrsmaychoosetoextendandthespecificationinjspbasic,necessaryfunction.jspenginecansupportavarietyofpowerfulscriptinglanguageandobjectmodel.Intheindustrytoexpandtechnologicalcapabilitiesandtheuseofjspatthesametime,Sunalsopromisedtoguaranteejspplatformandservertechnologytomaintaininter-inherentportability.Strutscanbedefinedasawebapplicationdevelopmentframeworkthatisbasedontherequestsandisusedinordertodevelopthewebapplicationsofjavaenterpriseedition(JavaEE).ThestrutsframeworkisaModelViewController(MVC)basedframeworkandbytheuseofMVCthelogic,viewanduserinputrelatedtasksgetsseparatedandtheworkisdoneinaclearmannerthatcanbeverifiedeasily.Thewebframeworkofstrutsisknownastherequestbasedwebapplicationframework.Thestruts2isanefficientandextensibleactionframeworkusedinordertocreatetheenterpriselevelwebapplicationsinjavaandthislate
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 共同承包甲方合同范例
- 醫(yī)藥物流收購合同范例
- 培養(yǎng)學(xué)生審美素養(yǎng)的幼兒園教研計(jì)劃
- 兒童心理學(xué)家的咨詢項(xiàng)目與研究計(jì)劃
- 2025年自我保護(hù)中班標(biāo)準(zhǔn)教案
- 班級交流平臺建設(shè)計(jì)劃
- 品牌體驗(yàn)經(jīng)濟(jì)的興起與趨勢計(jì)劃
- 《貴州盛聯(lián)新能源投資有限公司赫章縣松林坡鄉(xiāng)騰達(dá)煤礦〔兼并重組(調(diào)整)〕礦產(chǎn)資源綠色開發(fā)利用方案(三合一)》專家組評審意見
- 縫紉機(jī)操作知識培訓(xùn)課件
- 營銷人員心理素質(zhì)專業(yè)培訓(xùn)教程優(yōu)化方案
- 5G手機(jī)無線通訊濾波芯片產(chǎn)業(yè)化項(xiàng)目環(huán)境影響報告表
- 工會野炊活動方案
- 《對外援援助成套項(xiàng)目勘察設(shè)計(jì)取費(fèi)標(biāo)準(zhǔn)內(nèi)部暫行規(guī)定(稿)》
- 通用反應(yīng)單元工藝
- 空冷塔施工方案
- Inplan 操作手冊初稿
- AFM-原子力顯微鏡簡介
- 實(shí)用的尺寸公差等級一覽表
- 公司資產(chǎn)無償劃轉(zhuǎn)職工安置方案安置方案
- 最新報銷菜單(精編版)
- 安全生產(chǎn)標(biāo)準(zhǔn)化全套檔案
評論
0/150
提交評論