问题标签 [cppcms]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
137 浏览

c++ - CppCMS 构建构造函数和声明

http://cppcms.com/wikipp/en/page/cppcms_1x_forms

据此,_

声明将一个或多个名称引入程序......因此,可以为每个编译单元声明类、结构、枚举类型和其他用户定义的类型

AFAIK,构造函数应该在myapp.cpp,而声明应该在content.h。所以我把

表格上有 5 个字段。在 CppCMS 中,使用 3 个代码构建的表单(第 4 个代码是字段的限制)

第一个代码:

第二个代码:

第三个代码:

第 4 个代码是对字段的限制:

我很困惑应该声明哪一个

- - - - - - - - - 添加

我尝试在myapp.cpp下面添加所有上述代码:

但它仍然给出错误:

0 投票
3 回答
1177 浏览

linux - cppcms - 共享库 - Linux

我正在尝试在 Linux(Debian 发行版)上使用 cppcms 框架。

我按照网站上构建教程中描述的步骤进行操作,然后尝试构建 hello world 应用程序。

我已经成功编译了源代码,但是当我尝试运行它时,出现以下错误:

./hello:加载共享库时出错:libcppcms.so.1:无法打开共享对象文件:没有这样的文件或目录

我对 Linux 比较陌生,所以我不得不进行一些研究并遇到了这些称为共享库的东西。据我了解,这些 *.so 文件正是我需要创建的。我还读到库的基本文件夹是 /home/usr/lib 所以我尝试将文件复制到该文件夹​​中,但它没有帮助。

我非常感谢任何可能让我解决这个问题的帮助。

谢谢!

0 投票
1 回答
248 浏览

c++ - cppcms 异步会话。模式

我使用此代码来运行异步。服务器:

在 gameServer 类中,我有以下代码:

当我编译并运行程序时,会session doesn't load显示消息。如果我main用同步替换该功能。server and remove session().load()and session().save(),没有错误,session["username"]可以显示。

这是我的配置文件

我的代码有什么问题?

0 投票
1 回答
262 浏览

routing - 模板文件中的 cppcms url 映射

当我将此路由添加到我的服务器时

  1. 如何分配此 routmapper().assign()以便能够将 routs 用作server/1/get/helloor server/2/get/hello
  2. 如何在带有 url 的模板文件中使用此路由?

<% url "1/get" using [a variable] %>有用吗?

0 投票
1 回答
183 浏览

cppcms - cppcms 中的角色或 url_mapper 是什么

在示例url mapping中,它保留了正则表达式 url 模式的映射及其对应的操作dispatcher().assign()。但工作是mapper().assign()什么?即使我评论它也有效。

在文档中它说

我们为此部分创建一个名为“数字”的名称,并提供 URL 格式化模式 /number/{1} - 与正则表达式相反,其中 {1} 是第一个参数的占位符,用于格式化适当的 URL。

但是为什么要为零件命名,为什么有必要呢?

0 投票
1 回答
121 浏览

linux - 在 CppCms 中更新模板而不重新启动应用程序

本教程中,它说:

动态链接有点棘手,但它更强大,因为它允许您在不重新链接应用程序的情况下加载皮肤。您甚至可以更新您的应用程序而无需重新启动它。

所以我决定对其进行测试,当应用程序运行时,我libmy_skin.so用另一个皮肤替换了文件。

正在运行的应用程序中的皮肤没有改变。

上面的陈述是不正确的,还是我做错了什么?

0 投票
2 回答
464 浏览

c++ - cppcms - why is hello world with url mapping not working?

I am having trouble with cppcms hello world example with url mapping.

I am having trouble with understanding this part:

In tutorial said /hello - welcome function would be called but that is not what is happening. This method is called instead:

Welcome method look like this and it is defined in a scope of hello class:

I need some answers if you can help me. I am just trying to understand so if you could point me to right direction it would be great.

0 投票
1 回答
752 浏览

c++ - cppcms,从表单中检索值

我想知道如何从纯 html 文件中检索 POST 字段,而不使用从 cppcms::form 继承的类。我想要实现例如这个类的类:

此方法在继承自 cppcms::application 的类中调用:

我想做的是检索“user”字段并将其放入“params”映射中,而不必让我的 Index 类继承自 cppcms::form 或使用“post”中的“get”方法。我希望 html 文件/类完全独立于 cppcms 框架。可能吗?谢谢你。

0 投票
1 回答
428 浏览

c++ - Typical CppCMS memory consumption

I'm developing a CppCMS app, for running on my ARM-based custom board. I'm running CppCMS behind Lighttpd using fastcgi. But apparently CppCMS consumes far more memory than Lighttpd does (50+ MB), which comes as a surprise to me.

DISCLAIMER: The memory consumption listed above was obtained using 'ps' applet of busybox, which may have issues regarding the reported memory use. Hence do NOT let my ramblings here discourage you from giving Artyoms excellent CppCMS a spin.

Before digging deeper into this, I would like to hear if anyone has some numbers on "common" consumption of CppCMS as a function of site complexity.

My setup: ARMv5TE, CodeSourcery GCC v 4.3.3, site includes 4 pages, and uses 2 types of forms.

update

I'm running CppCMS 1.0.4.

There is no SQL database, only a very simple C++ datastructure. Performing a "sizeof" on the combined set of objects in the structure is below 1 KiB.

My config-file looks as follows:

The reported 50+ MB memory consumption was dermined running 'ps' command on the deployment linux-box.

0 投票
1 回答
172 浏览

cppcms - CppCMS XML 解析器

CppCMS 中有 XML 解析器吗?我正在设计的应用程序包括访问多个 Web 服务。为了开发 Web 服务客户端,是否有内置的 WSDL/XML 解析器,或者,我是否必须依赖某些第三方解析器?或者,是否有使用 JSON 的解决方法/有效方法。

顺便说一句,我是 C/C++ 开发人员,而不是 Web 开发人员。回答前请记住。