skip to main content

Appendices : HTTPHandler class (com.iscobol.rts.HTTPHandler) : Constructor and methods : processHtmlFile

processHtmlFile
Process an HTML file replacing items delimited by %% characters by the corresponding COBOL data item.
General format
boolean processHtmlFile (htmlFile)
Syntax rules
1.
htmlFile is a level 01 data item for which the IS IDENTIFIED clause has been used.
General rules
1.
htmlFile’s 01 level is identified by the name of the HTML file to be processed while the subsequent variable identifiers are searched in the file inside the delimiters '%%' (or prefixed by colon, depending on the iscobol.http.value_prefix_colon (boolean) setting). The file is loaded in the directory (or directories) specified by the configuration property iscobol.http.html_template_prefix *.
2.
3.
Example
Consider having a file named "mypage.html" with the following content:
  <p>This page has been shown by %%cobolname%%</p>
The following COBOL program will display the above HTML with "isCOBOL" instead of "cobolname".
       CONFIGURATION SECTION.
       REPOSITORY.
          CLASS WEB-AREA AS "com.iscobol.rts.HTTPHandler"
       WORKING-STORAGE SECTION.
       01  html identified by "mypage".
           03 identified by "cobolname".
              05 cob-name pic x any length.
       LINKAGE SECTION.
       01 LNK-AREA OBJECT REFERENCE WEB-AREA.
       PROCEDURE DIVISION USING LNK-AREA.
           move "isCOBOL" to cob-name.
           LNK-AREA:>processHtmlFile(html).

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left