Basic VSP Programming
VS-B-4 Emitting Output to the User Agent
How to send data to the user-agents
Preliminaries
- The Virtuoso Web server writes the content that is to be sent into the internal string session.
- The internal string session will be sent to the user-agent after VSP execution (if there is no unhandled SQL errors).
- There is full control over an internal session. It can be cleared, filled and flushed. Note when flushing an internal session the task will be executed in background, and no output will be sent after this action.
- The character data can be encoded in various ways. A default encoding (CharSet) can be defined in the database INI file
HTTP session control functions
- http() - writes a string into the internal string session without conversion.
- http_value() - writes a string with escapes into the internal string session.
- http_rewrite() - clears the internal string session
- http_flush() - flushes the internal string to the user-agent and continues processing in background.
- <?=var ?> - a shortcut to write a variable (or function) from an HTML section.
HTTP formatting and charset functions
- sprintf() - the special codes %V and %U used for HTML and URL escaping respectively.
- http_url() - converts argument to a URL escaping special characters. Result written to internal session.
- http_value() - converts argument to HTML escaping special characters. Result written to internal session.
- current_charset() - returns name of the current charset.
Examples
- Use of http().
- Use of http_value().
- Use of http_rewrite().
- Use of http_url().
- Use of <?= ?> tags.
- Use of sprintf().
| View the source | Action |
|---|---|
| 1. vs_b_4_sample_1.vsp | Run |
| 2. vs_b_4_sample_2.vsp | Run |
| 3. vs_b_4_sample_3.vsp | Run |
| 4. vs_b_4_sample_4.vsp | Run |
| 5. vs_b_4_sample_5.vsp | Run |
| 6. vs_b_4_sample_6.vsp | Run |
OpenLink Home
Technical Support