2 つのディレクトリがあり、どちらもデバッグ用に同じ内容を持っています。1 つはタイトルzxc、もう 1 つは というタイトルwelcomeです。welcome次のコードを使用して、アクションにディレクトリを使用させようとしています:
<action name="welcome">
<result>/welcome/welcome.jsp</result>
</action>
使用する<result>/zxc/welcome.jsp</result>と、ページが正常に表示されます。上記を使用すると、<result>/welcome/welcome.jsp</result>が得られerror 404 - resource not foundます。
編集1:
welcomeまた、URLが空白のままの場合に基本的にリダイレクトするこのアクションもあります。
<action name="">
<result type="redirect">welcome</result>
</action>
編集2:
struts.xml 構成:
<package name="website" namespace="/" extends="struts-default, json-default">
...
</package>
上記のアクションは両方とも、このパッケージ内にあります。