Total Knowledge: CPPSERV: Documentation: Writing C++ Servlets

CPPSERV: Documentation: Writing C++ Servlets


Home Projects Jobs Clientele Publishing Contact

Writing Servlets

Once you got servlet engine installed, writing servlets is fairly easy.

  • Create a class derived from cserv::Servlet
  • Add EXPORT_SERVLET(YourServletClassName) in your source file that defines servlet functions
  • Compile your servlet as shared library and link it with -lcserv
  • Add your servlet to configuration file:
    <servlet name="MyServlet" dso="path/to/MyServlet.so"/>

Note: engine and servlet need to be compiled by same GCC version.

Note: servlet must be compiled and linked with the same version of libcserv as cppserv version it will run in.

SourceForge.net Logo

Authoright © Total Knowledge: 1999-2013