【发布时间】:2021-09-02 01:50:41
【问题描述】:
我想将一个新的 Angular 11 项目集成到一个旧的、遗留的 Struts 1.3 项目中。我将 Angular 放在一个文件夹中,并设置了 package.json,以便将构建文件与其余 Struts 文件一起放入 /webapp 目录:
+--src
| +-- java
| +-- ui (Angular files)
| +-- webapp (Struts)
| | +-- angular build files
| | +--web-inf (Struts public files)
我通过 JSP 页面上的操作链接链接到我的 Angular 静态 html:
<html:link action="ConfigurationDataSetup.do">
我的struts-config.xml 有一个匹配的操作:
<action
path="/ConfigurationDataSetup"
type="org.apache.struts.actions.ForwardAction"
name="ConfigurationDataSetup"
parameter="/angular/configurationDataSetup.html">
</action>
当我在本地 WebLogic 服务器上为项目提供服务时,我收到 404 错误,表明该项目找不到我的静态角度资源的其余部分。我认为是因为出于某种原因它正在项目的根目录中寻找它们:
GET http://localhost:7001/styles.css net::ERR_ABORTED 404 (Not Found)
GET http://localhost:7001/runtime.js net::ERR_ABORTED 404 (Not Found)
GET http://localhost:7001/main.js net::ERR_ABORTED 404 (Not Found)
GET http://localhost:7001/polyfills.js net::ERR_ABORTED 404 (Not Found)
GET http://localhost:7001/vendor.js net::ERR_ABORTED 404 (Not Found)
我通过localhost:7001/ScoreReportsWorkbench访问该项目。
这是为我的登录页面提供服务的 URL。
知道为什么我无法访问这些文件吗?
【问题讨论】: