Struts1とStruts2の両方を備えたJavaWebアプリがあります。アプリ内には、いくつかのStruts2名前空間とStruts1モジュールがあります。例えば:
/public (Struts 1 module)
/accounting (Struts 2 namespace)
/auditing (Struts 2 namespace)
/receipts (Struts 1 modules)
私のweb.xmlでは、Struts1および2フィルターは特に正しい名前空間/モジュールにマップされています。例えば、
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/accounting/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts1</filter-name>
<url-pattern>/public/*</url-pattern>
</filter-mapping>
Struts 1エリア内で、Struts1アクションをStruts2アクションに転送するように要求されました。私は次のことを試しました:
<action path="/myRedirect" forward="/checkAccountRecords.action" module="accounting" />
ただし、これにより、次のスタックトレースが生成されます。
The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag. - [unknown location]
これは、Struts2フィルターを介してWebサイトのStruts1部分をマッピングすることで修正できることを知っていますが、これは特定のWebサイトに問題を引き起こすため、これは避けたいと思います。
モジュールなしでアクションも試しました:
<action path="/myRedirect" forward="/accounting/checkAccountRecords.action" />
次のエラーが発生しました:
can't find /receipts/accounting/checkAccountRecords.action (file not found)
また、次のアクションマッピングも試しました。
<action path="/myRedirect" forward="../accounting/checkAccountRecords.action" />
次のエラーが発生しました:
Path ../accounting/checkAccountRecords.action does not start with a "/" character
それで、私が試すことができるものは残っていますか?Struts1アクションを取得してStruts2アクションへのリダイレクトを返すにはどうすればよいですか?