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下操作。至于出现该错误的原因,限于篇幅和不浪费大家的时间,这里就不多讨论。)