溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

WebLogic的初步研究(2)--結(jié)構(gòu)篇

發(fā)布時間:2020-08-11 19:11:09 來源:ITPUB博客 閱讀:175 作者:rainytag 欄目:編程語言

要學(xué)習(xí)好一套系統(tǒng)首先要了解它的結(jié)構(gòu),本文詳細(xì)的介紹 WebLogic 的一些結(jié)構(gòu)和特點:

WebLogic的大部分配置是在 weblogic.properties 里完成的,只要仔細(xì)的研究這個文件就可以清楚得知關(guān)于 WebLogic 的一些結(jié)構(gòu)和特點,下面就對 weblogic.properties 文件里的一些配置項作一些說明:

weblogic.httpd.documentRoot=public_html/
這就是WebLogic 的WEB 服務(wù)器的根目錄,即是目錄/weblogic/myserver/public_html/

weblogic.password.system=sdfjkdshfds
這個前文已經(jīng)提到,是設(shè)置管理員密碼。

weblogic.system.listenPort=7001
這是設(shè)置 WebLogic 的 WEB 服務(wù)器端口。

weblogic.httpd.servlet.classpath=/weblogic/myserver/servletclasses
設(shè)置Servlet存放的路徑

關(guān)于Servlet

出于安全的目的,在 WebLogic 下運行的 WebLogic 最好在 weblogic.properties 里登記后才能運行,例如上文的提到Servlet http://localhost:7001/helloWorld,
它在weblogic.properties 里的登記項是
weblogic.httpd.register.helloWorld=examples.servlets.HelloWorldServlet
實際上,這個 Servlet 的實際路徑是
/weblogic/myserver/servletclasses/examples/servlets/HelloWorldServlet.class
對照一下weblogic.properties里的登記項和HelloWorldServlet.class文件的路徑,應(yīng)該不難找出其登記Servlet的規(guī)律吧。

在weblogic.properties里有一下幾個Servlet的登記項:

weblogic.httpd.register.AdminEvents=admin.AdminEvents
weblogic.httpd.register.AdminClients=admin.AdminClients weblogic.httpd.register.AdminConnections=admin.AdminConnections weblogic.httpd.register.AdminJDBC=admin.AdminJDBC
weblogic.httpd.register.AdminLicense=admin.AdminLicense
weblogic.httpd.register.AdminMain=admin.AdminMain
weblogic.httpd.register.AdminProps=admin.AdminProps
weblogic.httpd.register.AdminRealm=admin.AdminRealm
weblogic.httpd.register.AdminThreads=admin.AdminThreads weblogic.httpd.register.AdminVersion=admin.AdminVersion

這就是管理員管理 WebLogic 用的Servlet,通過URL訪問http://localhost:7001/AdminMain,在彈出的身份驗證對話框了輸入 system 和在 weblogic.password.system= 設(shè)置的密碼,就可以進(jìn)入 WebLogic 的Web管理界面進(jìn)行管理。

如果是為了方便一些,不經(jīng)登記就使用Servlet,那么可以在 weblogic.properties 里把
weblogic.allow.execute.weblogic.servlet.classes=everyone
weblogic.httpd.register.servlets=weblogic.servlet.ServletServlet
的注釋去掉,而對前面的提到的/weblogic/myserver/servletclasses/examples/servlets/HelloWorldServlet.class 的 Servlet 調(diào)用的URL是:
http://localhost:7001/servlets/examples/servlets/HelloWorldServlet
http://localhost:7001/servlets/examples.servlets.HelloWorldServlet

對于初學(xué)者來說也許不明白,為何目錄可以加“.”來區(qū)分,我的理解是因為通過閱讀源代碼得知HelloWorldServlet.class 是屬于examples.servlets這個包的,所以也可以以這個URL格式調(diào)用。

[@more@]
向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI