1
、抽象類和接口都不能被實例化;
2
、抽象類:抽象類中可以不包含抽象方法,即類中的方法都是非抽象的,但是在類的聲明中加上
abstract
,以使得該類是抽象的,目的是防止客戶端程序員創建該類的對象;
3
、接口中的方法總是
abstract and public
,不管是否被顯示的聲明;
4
、接口中的
field
只能是
public static final
;
5
、接口本身可以是
public or protected
;
6
、
extended class
必須實現抽象類中的所有抽象方法,
implemented class
必須實現接口中的所有方法,因為接口中的所有方法都是
abstract
。
Part One: The Web Tier
Section One: Configuring Web Applications
Mapping URLs to Web Components
When a request is received by the web container it must determine which web component should handle the request. It does so by mapping the URL path contained in the request to a web application and a web component. A URL path contains the context root and an alias:
http://host
:port
/context_root
/alias
A context root identifies a web application in a Java EE server. You specify the context root when you deploy a web module. A context root must start with a forward slash (/) and end with a string.
?
The alias identifies the web component that should handle a request. The alias path must start with a forward slash (/) and end with a string or a wildcard expression with an extension (for example, *.jsp). Since web containers automatically map an alias that ends with *.jsp, you do not have to specify an alias for a JSP page unless you wish to refer to the page by a name other than its file name.
Declaring Welcome Files
For example, suppose you define a welcome file welcome.html. When a client requests a URL such as host:port/webapp/directory, where directory is not mapped to a servlet or JSP page, the file host:port/webapp/directory/welcome.html is returned to the client.
If no welcome file is specified, the Application Server will use a file named index.
XXX
, where XXX
can be html
or jsp
, as the default welcome file. If there is no welcome file and no file named index.
XXX
, the Application Server returns a directory listing.
To specify a welcome file in the web application deployment descriptor, you need to nest a welcome-file
element inside a welcome-file-list
element. The welcome-file
element defines the JSP page to be used as the welcome page. Make sure this JSP page is actually included in your WAR file.
Setting Initialization Parameters
The web components in a web module share an object that represents their application context. You can pass initialization parameters to the context or to a web component.
To add a context parameter you need the following in the example's web.xml file:
- A
param-name
element that specifies the context object
- A
param-value
element that specifies the parameter to pass to the context object.
- A
context-param
element that encloses the previous two elements.
To add a web component initialization parameter you need the following in the example's web.xml file:
- A
param-name
element that specifies the name of the initialization parameter
- A
param-value
element that specifies the value of the initialization parameter
- An
init-param
element that encloses the previous two elements
Mapping Errors to Error Screens
Declaring Resource References
在LINUX中,忘記超級用戶root密碼該怎么辦呢?
(以下方法,我試過,實驗室安裝的Linux AS4.0系統,不知怎么回事,root的密碼改變了,我就用下面的方法改過來了,2005-09-08)
1.先在虛擬機中啟動Red Hat Linux。
2.在Grub引導程序中,在下面給出了一系列提示。有興趣的朋友可以都去試驗一下。我們這里按“e”鍵進入系統啟動前的Grub配置.
3.然后我們選擇中間那一項:“kernel /vmlinuz-2.4.20-8 ro root=LABEL=/”按“e”鍵進入編輯。(注:陰影部分不一定完全相同)
4.在“LABEL=/”后面輸入“空格+single”后回車。空格一定要記得輸!
5.然后選擇中間那一項:“kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ single”,按“b”鍵啟動單用戶模式系統。(注:陰影部分不一定完全相同)
6.如果你的系統前面出現“sh-2.05b#”這樣的提示符,那么恭喜你,你已經成功進入了單用戶模式。獎勵雞蛋一個!
7.在“sh-2.05b#”后面輸入“passwd root”后回車。出現了激動人心的輸入新密碼界面。
8.輸入新密碼并再次確定后,你的root用戶的密碼就成功更改了。
9.然后輸入“reboot”命令,重啟系統,下次登陸就可以用新密碼來使用root賬戶了。
有關Windows中忘記密碼時解決的相關知識:
1.在Windows中,本地賬戶都存儲在本地的SAM數據庫中。該數據庫存放在%systemroot%\system32\config文件下,文件名為SAM。(%systemroot%是個環境變量,代表系統目錄。在XP和Windows server 2003系列中,%systemroot%=Windows目錄,而在Windows2000系列中,%systemroot%=WinNT目錄)
2.在Windows中,當我們忘記超級管理員密碼時,可以在純DOS下對SAM改名或者直接刪除。這樣一來,在下次系統啟動時,超級管理員密碼就為空,然后你就可以重新為它設置密碼。(注意:該操作務必在純DOS下完成!記得有個朋友是這樣做的:他的系統是2000和2003的雙系統,當他忘記2000的超級管理員密碼時,他就想了一個看似很不錯的方法:在2003中直接對2000的SAM進行改名或刪除,然后再進入2000,出現了安全賬戶初始化失敗的錯誤。所以一定要記得在純DOS下操作。至于出現該錯誤的原因,限于篇幅和不浪費大家的時間,這里就不多討論。)