我知道在《在Linux服务器上部署产品的企业Pharo》一书中有一个很好的解释。我遵循了教程,并且能够部署相同的项目。然而,该项目只包含一个简单的类'MyFirstWebApp‘,并且不包含Seaside框架。运行脚本如下:
ZnServer defaultOn: 8080. ZnServer default logToStandardOutput. ZnServer default delegate map: 'image' to: MyFirstWebApp new; map: 'redirect-to-image' to: [ :request | ZnResponse redirect: 'image' ]; map: '/' to: 'redirect-to-image'. ZnServer default start。
如果您有一个包含许多使用Seaside框架的类的项目,该怎么办?我对自己的Seaside项目重复了相同的过程,但是当我使用下面的命令./pharo myapp.image run.st启动run.st脚本时,我得到了一条消息error WARequestContextNotFound。有什么想法吗?
发布于 2018-04-26 20:52:27
您将纯Zinc Server委托的使用与Seaside应用程序的处理混合在一起。Zinc为Seaside提供了一个“服务器适配器”,可以使用ZnZincServerAdaptor startOn: 8080 (或您选择的任何端口)进行设置。
如果你想运行Seaside web应用程序,你必须部署一个安装了Seaside框架的镜像,以及你自己的类(MyFirstWebApp和friends)。
所以你的run.st看起来会更像这样:
ZnZincServerAdaptor startOn: 8080.
ZnZincServerAdaptor default server debugMode: true.
ZnServer default logToStandardOutput.
"Here you register the Seaside application _class_"
(WAAdmin register: MyFirstWebApp asApplicationAt: 'image')
preferenceAt: #serverPath put: '/'.
WAAdmin defaultDispatcher defaultName: 'image'.https://stackoverflow.com/questions/50030981
复制相似问题