What's exactly is the web part of delphi web script?
Asked Answered
L

2

4

I'm currently starting to integrate "Delphi Web Script" in my application basically only as a scripting engine (interfacing with functions, classes, etc.); awesome software for the standard delphi open source quality in my opinion, but just for curiosity,

What's exactly the "web part" of the project?

How is intended to be used?

It was used somewhere with some success commercially?

Thanks!

Lapboard answered 27/12, 2011 at 4:56 Comment(0)
E
3

As ain said, the original use was for PHP-like, ASP-like server-side web-page generation, but it was also capable of general purpose use, which is what I used it for. And as I did not use the "web" side of DWScript, most of the "web-oriented" features haven't been ported over (only the HTML Filter was ported actually).

The Web functionality is still available in the SourceForge repository, if someone wants to tackle the port. Though, they may be outdated beyond simple renamed methods and classes, as since DWSII, the script engine has gained various features. For instance, it is now capable of multiple thread-safe executions of a single compiled script, while the old codebase is built around the limitation that a compiled script can be executed by only one thread at a time.

On the other hand, there are some new features that could simplify the porting, the simple WebServer demo recently added uses RTTI to expose TWebResponse & TWebRequest f.i. (was manually exposed in DWSII). On the down side, that's only possible with recent Delphi versions.

Eno answered 27/12, 2011 at 15:20 Comment(0)
T
2

AFAIK the main focus of the original author of this scripting engine was to make it possible to embed Pascal scripts into HTML pages, just like ie PHP does it. Hence the name "Delphi Web Script". While the focus of the current maintainer, Eric Grange, is on using it as a general purpose scripting engine, it should still be possible to use it for web purposes as well - for that you use the "filters" feature of the library. Check out the dwsHtmlFilter unit for HTML filter.

Trek answered 27/12, 2011 at 12:7 Comment(4)
PHP doesn't "embed" scripts in HTML pages. It is the script, and it generates HTML pages. Is that what you meant to say?Dinger
Kind of... I mean that you can have preproccessed HTML where you can have embeded script between special tags, ie <% ... %> (or <?php ... ?> in case of PHP). If you have a large file where half is "plain HTML" and half is some scripting language to be preproccessed then is it script which generates HTML or is it a HTML page which has a script embeded in it?Trek
PHP is always a script that generates HTML. Anything not in PHP tags is treated as echo statements. HTML interpreters (like browsers) don't do PHP, so it's definitely not PHP script embedded in HTML.Dinger
I guess it is kind of philoshopical question... I noted this in PHP manual: PHP, which stands for "PHP: Hypertext Preprocessor" is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.Trek

© 2022 - 2024 — McMap. All rights reserved.