Top / CGI Japanese

jj/CGI Module

Created: 2003-03-25
Last updated: 2003-09-20








by Fumisky Wells

  1. Overview
  2. jj/CGI Introduction
  3. Manual

Overview

jj/cgi is a CGI library for C++ based on jj/pattern and jj/errno.
I know there have been already many C++/CGI libraries, but building CGI library is not so difficult task so that I wrote this;-).

jj/CGI Introduction

The basic of CGI is out-of-scope in this document. Please see any other information for CGI itself. Here, describe how to use jj/CGI library to write CGI program by C++.
  1. For beginner(White Belt)
    1. Write C++ CGI Version of "Hello,World"
    2. Basic handling of CGI Form
  2. For Middle class(Green Belt)
    1. How to scan values of all fields in CGI form
    2. Handle Multiple-value Field (TBD)
    3. How to handle file uploading
  3. For Master class(Black Belt)
    1. How to handle Cookie (TBD)
    2. Form as Object, and Persistent form (TBD)

For beginner(White Belt)

  1. Write C++ CGI Version of "Hello,World"
    Source: hello.cpp (Need compile)
    Sample: hello

    First sample shows the most primitive case of CGI by C++. This doesn't use jj/CGI, but I think it is good introduction for it.

    That is, "Hello,World" by CGI/C++;-)

    I know this CGI doesn't have any advantage than static HTML text. This is just first example...

  2. Basic handling of CGI Form
    Source: put_a.cpp (Need compile)
    Sample: put_a.html

    put_a puts the value of text field named 'a'.

    put_a.cpp shows that creation of form object typed jjCGI_form, parse CGI input data, and get the value of field 'a' by form["a"].

For Middle class(Green Belt)

  1. How to scan values of all fields in CGI form
    Source: put_all.cpp (Need compile)
    Sample: put_all.html

    This sample shows how to scan all of values in the form.

    put_all.cpp shows how to use jj/Pattern library which is a base of jj/CGI.

  2. Handle Multiple-value Field
    Source: multi_value.cpp (Need compile)
    Sample: multi_value.html

  3. How to handle file uploading
    Source: fupload.cpp (Need compile)
    Sample: fupload.html

    In jj/CGI, uploaded file is accessed by user's CGI program through temporary filename saved at server as follows:
    form._server_filename[field_name]
    Where, form is an object of jjCGI_form class, field_name is a name comes from HTML form like:
    <input type="file" name="field_name">

    Usually, _server_filename[] member is enough to handle uploaded file. The other attributes related to file-uploading are as follows:

    _client_filename[]   Client side file name
    _ctype[]   type of file

For Master class(Black Belt)

  1. How to handle Cookie
    (TBD)
  2. Form as Object, and Persistent form
    (TBD)

Manual

Manual is generated by Doxygen (Thanks a lot!!). Please refer the manual.