我有一个具体的疑问。
在示例中,hello world 示例在浏览器中输入 URL 后,控件是转到 action servlet 还是 index.jsp 页面?我很困惑,因为在 web.xml 中,欢迎文件是 index.jsp。
我有一个具体的疑问。
在示例中,hello world 示例在浏览器中输入 URL 后,控件是转到 action servlet 还是 index.jsp 页面?我很困惑,因为在 web.xml 中,欢迎文件是 index.jsp。
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
只有*.do被映射到 ActionServlet。因此,只有以 结尾的 url*.do才会转到 ActionServlet。