本文介绍了是否可以在IBM Websphere Application Server上部署Angular应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用IBM RAD进行开发,并将IBM Websphere Application Server用作我们的Web应用程序服务器.考虑到这些限制,是否仍有可能开发和部署Angular SPA?像为RAD安装Typescript插件一样,但是如果没有生成EAR文件,您将如何将其部署到WAS?

We're using IBM RAD for development and IBM Websphere Application Server as our web app server here at work. Give these constraints, would it still be possible to develop and deploy Angular SPAs? Like install a Typescript plugin for RAD probably, but how will you deploy it to WAS if there are no EAR files generated?

推荐答案

您需要创建一个Web模块(如果尚未安装)并打包Angular构建的结果(dist/的内容)目录,默认情况下在Angular 2中)进入Web模块的根目录,以便可以将其作为静态内容使用.在Eclipse中,WebContent文件夹的内容位于战争的根源.然后,让RAD将您的Web模块打包成一场战争,并可能进行部署.

You'll need to create a web module (if you haven't already) and package the result of the Angular build (the contents of the dist/ directory, by default in Angular 2) into the root of your web module, so that it can be served as static content. In Eclipse, the contents of the WebContent folder are placed in the root of the war. Then let RAD package up your web module into a war and possibly ear and deploy it.

该Web模块在您的Web模块中的web.xml中应该具有以下内容,以便允许将深层链接重定向回SPA,以便路由器可以正确地路由它们:

That web module should have the following in web.xml in your web module, in order to allow deep links to be redirected back to the SPA so the router can route them properly:

<error-page>
    <error-code>404</error-code>
    <location>/</location>
</error-page>

这篇关于是否可以在IBM Websphere Application Server上部署Angular应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 02:04