1 Star 0 Fork 2

cppcoder/cppcms

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
hello.cpp 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
Artyom Beilis 提交于 2010-08-29 01:15 +08:00 . Spell fixes - closing 3052945
#include <cppcms/application.h>
#include <cppcms/applications_pool.h>
#include <cppcms/service.h>
#include <cppcms/http_response.h>
#include <iostream>
#include "content.h"
using namespace std;
class hello: public cppcms::application {
public:
hello(cppcms::service &s) :
cppcms::application(s)
{
}
void main(std::string /*unused*/)
{
content::message c;
if(request().request_method()=="POST") {
c.info.load(context());
if(c.info.validate()) {
c.name=c.info.name.value();
c.sex=c.info.sex.selected_id();
c.state=c.info.marital.selected_id();
c.age=c.info.age.value();
c.info.clear();
}
}
render("message",c);
}
};
int main(int argc,char ** argv)
{
try {
cppcms::service app(argc,argv);
app.applications_pool().mount(cppcms::applications_factory<hello>());
app.run();
}
catch(std::exception const &e) {
cerr<<e.what()<<endl;
}
}
// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/yyxtyk/cppcms.git
git@gitee.com:yyxtyk/cppcms.git
yyxtyk
cppcms
cppcms
master

搜索帮助