页,值为”en_US”(英语系)。
图23 MainServlet之init. Parameter设定
对应设定文件位置在
Petstore_home\src\apps\petstore\src\docroot\WEB-INF\mappings.xml
,我们可在约95行找到customer.do的相关设定
<url-mapping url="customer.do" screen="customer.screen" >
<web-action-class>com.sun.j2ee.blueprints.petstore.controller.web.actions.CustomerHTMLAction</web-action-class>
</url-mapping>
这一段卷标(tag)有三个参数:
url:标示对应动作
web-action-class:实际执行类别
screen:结果显示画面
*.do的运作机制是Servlet接收到request,从mappings.xml找到对应的url,
RequestProcessor将对应的web-action-class初始化并执行,ScreenFlowManager
将执行结果传回给*.screen,再运用本系列前两篇所介绍*.screen机制组成实际画面,响应给使用者,大致的流程是这样,实际上更复杂,因牵涉到Web tier与EJB tier间沟通,但以本例来说,RequestProcessor对应web-action-class(CustomerHTMLAction)并没有做什么事,后续RequestProcessor接收到结果显示画面(customer.screen),则进行转导(forward)动作。
mappings.xml读取后转成HashMap类别存入ServletContext供所有进入
Petstore系统的人使用,接着将ScreenFlowManager及RequestProcessor初始
化并存入ServletContext。






