在圖3中你可以點(diǎn)擊“Register with the MailReader Demonstration application”注冊(cè)一個(gè)MailReader用戶(hù),或直接點(diǎn)擊“Log on to the MailReader Demonstration Application”,輸入用戶(hù)名和密碼(示例程序已經(jīng)預(yù)置了一個(gè)用戶(hù)user/pass,配置在struts-example下的WEB-INF/database.xml文件中)登入。 分析 web.xml 在圖3所示的頁(yè)面中,點(diǎn)擊“Log on to the MailReader Demonstration Application”鏈接,進(jìn)入/logon.jsp頁(yè)面,輸入預(yù)定義的用戶(hù)名為user、密碼為pass,然后提交就進(jìn)入了圖4的用戶(hù)主頁(yè)面。 圖3 struts example主頁(yè)面 圖4 用戶(hù)主頁(yè)面 大家可能已經(jīng)注重到了,這里的URL的后綴是.do。那么它有什么意義?服務(wù)器又是怎樣處理這樣的請(qǐng)求呢?下面我們看看{TOMCAT}/WEB-INF/web.xml文件,就會(huì)非常清楚。在web.xml中,你可以找到如下配置片斷: