Delphi (Kylix) development WML program configuration Raiders
Delphi (Kylix) provides WebSNAP technology to develop web programs, and the difference between web programs and WAP programs is different, and Content-Type in the HTTP stream is different.
HTTP's Content-Type is Text / HTML
WAP content-type is Text / WML
The following example is passed in the Kylix environment under Linux, and this is similar to this in delphi.
1. First download the HTTP protocol debugger httpdebug.exe. Check content-type content. TEXT / HTML
2, analyze WebSnap, in the Kylix installation directory, take Kylix3 as an example, the default installation directory is under / usr / local / kylix3.
In / usr / local / kylix3 / source / internet directory, execute
GREP "text / html" * -ri
The results are as follows:
Apacheapp.pas: r.content_type: = 'text / html'; apachehttp.pas: contentty: = 'text / html'; binary cgiapp.dcu matches cgiapp.pas: 'content-type: text / html' # 13 # 10 {do not localize} CGIHTTP.dcu binary matching CGIHTTP.pas: ContentType: = 'text / html'; {do not localize} CGIHTTP.pas: ContentType: = 'text / html'; {do not localize} DBAdaptImg .pas: response.contentType: = 'text / html'; // for any Exceptions That May Happen binary OxmLDom.dcu matches oxmldom.pas: indehttp.request.accept: = 'text / xml, text / html, application / OcTet-stream '; {do not localize} Sockhttp.pas: contentty: =' text / html '; {do not localize} SockHttp.pas: contentty: =' text / html '; {do not localize} SockHttp.pas: 'Content-Type: Text / HTML' # 13 # 10 // NOT RESOTSVRHTTPINDY.PAS: ContentType: = 'text / html'; svrhttpindy.pas: contentTyPE: = 'text / html';
3, then look at the header file introduced in the WebSnap template is related to WebSnap, and there are three files containing text / html:
Cgiapp.pas
CGIHTTP.PAS
DBADAPTIMG.PAS
4, three files, copy one copy, the name before the name is WAP, and modify the Unit name consistent with the file name, modify the text / html to Text / WML
(1) cp cgiapp.pas wapcgiapp.pas
vi wapcgiapp.pas
Modify the Unit cgiapp in the header of the file to Unit Wapcgiapp
Replace the text / html for Text / WML
(2) cp cgihttp.pas wapcgihttp.pasvi wapcgihttp.pas
Modify the Unit cgihttp of the file header for Unit WapcgiHTTP
Replace the text / html for Text / WML
(3) CP dbadaptimg.pas wapdbadaptimg.pas
vi wapdbadaptimg.pas
Modify the Unit Dbadaptimg of the file header for Unit Wapdbadaptimg
Replace the text / html for Text / WML
5, after compiling, put it in / usr / local / kylix3 / lib directory
(1) DCC wapcgiapp.pas
DCC wapcgihttp.pas
DCC WAPDBADAPTIMG.PAS
(2) CP WAP * .dcu / usr / local / kylix3
6. After creating a WebSNAP application,
CGIApp in Usees can be changed to wapcgiapp.
The corresponding CGIHTTP and DBADAPTIMG appearing in the module are also replaced with WAPCGIHTTP or WAPDBADADAPTIMG.
Compile the program.
7, check the results with httpdebug.
?