在图3中你可以点击“Register with the MailReader Demonstration application”注册一个MailReader用户,或直接点击“Log on to the MailReader Demonstration Application”,输入用户名和密码(示例程序已经预置了一个用户user/pass,配置在struts-example下的WEB-INF/database.xml文件中)登入。 分析 web.xml 在图3所示的页面中,点击“Log on to the MailReader Demonstration Application”链接,进入/logon.jsp页面,输入预定义的用户名为user、密码为pass,然后提交就进入了图4的用户主页面。 图3 struts example主页面 图4 用户主页面 大家可能已经注重到了,这里的URL的后缀是.do。那么它有什么意义?服务器又是怎样处理这样的请求呢?下面我们看看{TOMCAT}/WEB-INF/web.xml文件,就会非常清楚。在web.xml中,你可以找到如下配置片断: