gpt4 book ai didi

struts-1 - Struts 1 Action 从 struts-config 向前调用到另一个 struts-config 文件中的另一个 Action

转载 作者:行者123 更新时间:2023-12-02 00:12:59 28 4
gpt4 key购买 nike

我正在尝试从 struts-config 调用使用 struts 1 中的操作转发属性,并且我想调用另一个操作,它位于另一个 struts.config 文件中。显然它不起作用!

我的代码是:

In "struts-misExpedientes.xml" 
<action path="/s99bIrInicio" forward="$$$WEBROOT_ENVIRONMENT$$$/comunJSP/s99binicio.do">

the other xml file is "struts-comun.xml"
<action path="/s99binicio" forward="/s99bIrWelcomeMensajeDia.do" />

笔记: "WEBROOT_ENVIRONMENT"是我在属性文件中声明的变量,其值为 [http://localhost:8100/s99bEnvironmentWar]

我感谢您提供的任何想法。

最佳答案

如果您的意思是要从一个 webapp 转发到另一个 webapp,那么这是不可能的。每个 webapp 都与其他 webapp 隔离。每个都有自己的 awn 类、库和 session ,与另一个不同。因此,将 HttpRequest 对象从一个传递到另一个是没有意义的。
您可能应该重定向到另一个 web 应用程序。顺便说一句,Struts 不鼓励 Action 链接,即使在可能的情况下,在单个 wepapp 中也是如此。
编辑:看来您正在使用模块。那怎么办the documentation说:

There are three approaches for switching from one module to another.

  • You can use the org.apache.struts.actions.SwitchAction from the Extras JAR,
  • you can use a <forward> (global or local) and specify the contextRelative attribute with a value of true,
  • or you can specify the "module" parameter as part of any of the Struts JSP hyperlink tags (Include, Img, Link, Rewrite, or Forward).

关于struts-1 - Struts 1 Action 从 struts-config 向前调用到另一个 struts-config 文件中的另一个 Action ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14607214/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com