2

我有一个具体的疑问。

在示例中,hello world 示例在浏览器中输入 URL 后,控件是转到 action servlet 还是 index.jsp 页面?我很困惑,因为在 web.xml 中,欢迎文件是 index.jsp。

4

2 回答 2

2

When ever the request comes from the browser the struts controller(ActionServlet) will checks the url-pattern of *.do from servlet-mapping tag in web.xml.

Every request should come to web.xml before to process mappings. Based on mappings it goes next to struts-config.xml file to which action or form should call.

you can look into this Simple Struts Login Application

于 2012-07-03T13:03:08.973 回答
2

只有*.do被映射到 ActionServlet。因此,只有以 结尾的 url*.do才会转到 ActionServlet。

于 2012-07-03T12:22:58.877 回答