从 webMathematica 提供 CDF
假设我将以下(编辑过的)代码片段输入到 Mathematica 中。
manip = Manipulate[x, {x, 0, 1}];
nb = Developer`UseFrontEnd[
CreateDocument[manip, ShowCellBracket -> False,
Visible -> False]];
nbTest = ExportString[nb, "NB"] =!= $Failed;
cdfTest = ExportString[nb, "CDF"] =!= $Failed;
version = First[StringSplit[SystemInformation["Kernel", "ReleaseID"]]];
{{nbTest, cdfTest},version}
我发现 nbTest 和 cdfTest 都是 True。如果我在 webMathematica 中运行相同的命令,则 nbTest 为 True,但 cdfTest 为 False。您可以在这里看到结果:
http://www.cs.unca.edu: 8082/webMathematica/generateCDF.jsp
您可以在此处查看生成该结果的代码:
http://www.cs.unca.edu:8082/webMathematica/generateCDF.jsp .txt
我搜索了 webMathematica 的安全配置以找到启用 CDF 导出的方法,但没有找到。有谁知道如何启用此功能?当然,在这种情况下可能会故意禁用它。
我的目的是提供从通过 HTML 表单访问的 JSP 页面动态生成的 CDF 文档。这应该允许与文本输入结合的良好 CDF 交互。
编辑:我已经更新了服务器上的 Mathematica 版本,并更新了上面的代码,以便显示完整版本字符串。因此,我们可以看到它的版本是8.0.1。问题仍然存在。
Suppose I enter the following (edited) snippet of code into Mathematica.
manip = Manipulate[x, {x, 0, 1}];
nb = Developer`UseFrontEnd[
CreateDocument[manip, ShowCellBracket -> False,
Visible -> False]];
nbTest = ExportString[nb, "NB"] =!= $Failed;
cdfTest = ExportString[nb, "CDF"] =!= $Failed;
version = First[StringSplit[SystemInformation["Kernel", "ReleaseID"]]];
{{nbTest, cdfTest},version}
I find that both nbTest and cdfTest are True. If I run the same command from within webMathematica, nbTest is True but cdfTest is False. You can see that result here:
http://www.cs.unca.edu:8082/webMathematica/generateCDF.jsp
You can see the code that generates that result here:
http://www.cs.unca.edu:8082/webMathematica/generateCDF.jsp.txt
I have searched the security configuration of webMathematica to find a way to enable CDF export but have found none. Does anyone know a way to enable this? Of course, it might be disabled in this context intentionally.
My intention is to serve CDF documents generated dynamically from a JSP page accessed via an HTML form. This should allow nice CDF interaction in conjunction with textual input.
Edit: I've updated the version of Mathematica on our server and updated the code above so that the full version string appears. Thus, we can see that it is version 8.0.1. The problem persists.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
马克,
您可以尝试将 ExportString[ ..., "CDF" ] 包装在UsingFrontEnd 中,看看是否有帮助?
Mark,
Could you try wrapping the ExportString[ ..., "CDF" ] in UsingFrontEnd and see if that helps?