Try OpenEdge Now
skip to main content
Developing WebSpeed Applications
WebSpeed API Reference : process-web-request
 

process-web-request

This is the primary procedure for handling Web requests. Web objects run this procedure to respond to form input, as well as to generate HTML pages.

Location

web\template\html-map.w
web\template\wrap-cgi.w

Parameters

None

Notes

*Both the HTML Mapping Procedure and CGI Wrapper Procedure templates provide suggested code for this routine (the code differs between the two templates). The specific requirements of your Web objects might require modification of that code.
*When the Main Code Block of a Web object runs, it calls process-web-request. If a Web object is state-aware, subsequent calls to the Web object from the Web browser also run process-web-request.
*This procedure has four basic functions:
*It determines the context in which it is running. This can be done by checking REQUEST_METHOD or by explicitly using get-field or get-cookie to determine how the Web object was called.
*Once the context is determined, process-web-request calls outputHeader (unless modified otherwise). This sets the MIME header and any cookies on the HTML page that is being returned.
*Optionally, process-web-request will read form input from the Web request and populate local fields and variables. This will only be done if the context found in the first step indicates that data is being submitted with the form.
*In all cases, a Web object will cause some sort of response to be returned to the WEBSTREAM. This can be an HTML form generated by the Web object itself, or a response generated by a second Web object called by the current Web object.
*Note that outputHeadermust be run from process-web-request prior to generating any HTML code. It is also important that all new cookies are created prior to the call to outputHeader.
*If one Web object is going to run another Web object, it is also important to remember that they should not both run outputHeader. Only the Web object that is actually creating the HTML page should run outputHeader.

Examples

RUN process-web-request.

See also

run-web-object