Try OpenEdge Now
skip to main content
Developing WebSpeed Applications
Web Objects : HTML mapping examples : Simple HTML mapping : Editing process-web-request
Editing process-web-request
The process-web-request procedure is where you add the SpeedScript FIND statement for w-cstget.w.
Note: Instead of editing process-web-request to add the FIND statement, you could have used the HTML Mapping Wizard to define a query. When you use the wizard, your query is added as an override to the findRecords procedure.
When you view the process-web-request procedure (listed under Code Sections in the tree view of the HTML mapping source) in the Section Editor, you will see that it a runs a number of procedures that control the flow of information between the client and the Web object, and between the Web object and the data source. It also generates header information for the HTML output.
The procedures (assignFields, displayFields, etc.) contain default behavior that you can override. The super procedure, install-path/tty/web2/html-map.r, defines their behavior. You override the default behavior by creating local versions of the procedures. The WebSpeed agent first looks in the Web Object for a procedure. If the procedure is not found in the Web Object, the agent looks for it among registered super procedures. For more information about super procedures, see OpenEdge Development: ABL Reference.
Also note that process-web-request runs a different sequence of processes depending on whether the METHOD attribute for the HTML form element is GET or POST. With GET, data from the client request is appended to the URL of the Web object. Usually, GET code processes the first request and returns a blank form. With POST, data is sent to the Web object as a separate stream. Usually, POST code processes subsequent requests.
The area in bold text shows where the FIND statement was added to process-web-request in order to create w-cstget.w:


. . .
/* STEP 2 -
* If there are DATABASE fields, find the relevant record that needs to be
 * assigned.
  RUN findRecords.
  FIND Customer WHERE Customer.CustNum EQ
  . . .
Notice that the default Run findRecords was commented-out.