struts2 设置特定上下文根时的命名空间配置
struts2 Namespace configuration when set a specific context-root
当我在 weblogic.xml 中为我的应用程序设置上下文根时,struts2 中包的默认命名空间是什么?
例如:
我设置 <context-root>/home/app/exec</context-root>
并使用以下 uri 访问我的应用程序:localhost:8081/home/app/exec/index.html
insted of localhost:8081/NameOfMyApp/index.html
另一方面,我知道在 Struts2 操作命名空间映射到文件夹结构。
以下示例 link:https://www.mkyong.com/struts2/struts-2-namespace-configuration-example-and-explanation/
在 ServletContext
不是我的应用程序名称而是上下文根的情况下,正确的命名空间是什么?
命名空间是在上下文路径之后和动作名称之前计算的部分。另一方面,命名空间是包含属于该命名空间的操作的包的属性。默认的动作映射器使用这两个属性来查找对应于命名空间和动作名称的动作配置。
有关默认操作映射器的详细说明,您可以阅读 javadocs DefaultActionMapper。
您可以在 Struts 文档站点上阅读有关 action configuration and ActionMapper 的更多信息。
你应该也知道,action mapper returns ActionMapping. However, to execute an action requires ActionConfig 是由 Struts 使用 运行 时配置决定的。
当我在 weblogic.xml 中为我的应用程序设置上下文根时,struts2 中包的默认命名空间是什么?
例如:
我设置 <context-root>/home/app/exec</context-root>
并使用以下 uri 访问我的应用程序:localhost:8081/home/app/exec/index.html
insted of localhost:8081/NameOfMyApp/index.html
另一方面,我知道在 Struts2 操作命名空间映射到文件夹结构。 以下示例 link:https://www.mkyong.com/struts2/struts-2-namespace-configuration-example-and-explanation/
在 ServletContext
不是我的应用程序名称而是上下文根的情况下,正确的命名空间是什么?
命名空间是在上下文路径之后和动作名称之前计算的部分。另一方面,命名空间是包含属于该命名空间的操作的包的属性。默认的动作映射器使用这两个属性来查找对应于命名空间和动作名称的动作配置。
有关默认操作映射器的详细说明,您可以阅读 javadocs DefaultActionMapper。
您可以在 Struts 文档站点上阅读有关 action configuration and ActionMapper 的更多信息。
你应该也知道,action mapper returns ActionMapping. However, to execute an action requires ActionConfig 是由 Struts 使用 运行 时配置决定的。