QtWebApp (lib)

Browser

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

0
5.0
Description:

QtWebApp is a library that supports you in developing web server applications. It contains four modules that can be used independently of each other:

The multi-threaded HTTP(S) 1.1 Server decodes incoming HTTP requests and passes them to you custom request handler, which produces the HTTP response. It supports HTTPS, cookies, sessions and file-uploads.

The Template Engine text based documents (e.g. HTML, XML, JSON) by replacing placeholders with variable data. It can display or hide parts conditionally and repeat sections to output lists and tables. There is also support for i18n.

The Logger writes messages to files. It creates new files after a certain size and keeps a number of backups. The logger can hold back debug messages in a buffer as long no problem occurs but write them into the file if an error occurs. All logger settings become effective at runtime without program restart.

The package includes also a copy of Nokias qtservice helper library, which turns your program into a real Windows Service.

You can simply copy the source codes of QtWebApp into your project or use it as a shared library.

The API is similar to Java servlets. Example:

void MyController::service(HttpRequest& request, HttpResponse& response) {

// Get some request parameters
QByteArray path=request.getPath();
QByteArray username=request.getParameter("username");

// set some headers
response.setHeader("Content-Type", "text/plain; charset=ISO-8859-1");
response.setCookie(HttpCookie("myCookie","hello",600));

// generate response
response.write("Hello ");
response.write(username);
}

int main(int argc, char *argv[]) {

QCoreApplication* app=new QCoreApplication(argc,argv);
QSettings* settings=new QSettings("etc/configfile.ini",QSettings::IniFormat,app);
MyController* controller=new MyController(app);
HttpListener* listener=new HttpListener(settings,controller,app);

return app->exec();
}


Be the first to comment
12345678910
product-maker Count:2 Rating: 5.00
File (click to download) Version Description PackagetypeArchitectureRelease Channel Downloads Date Filesize DL OCS-Install
Pling
*Needs ocs-url or ocs-store to install things
Details
license
version
1.6.4
updated Jun 06 2016
added Jul 23 2012
downloads today
0
page views today 5
System Tags app software
+