Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
HttpView2
Last updated at 1:01 pm UTC on 7 September 2017
No Files. No HTML. Just Smalltalk code!

HttpView2, also known as HV2 is a lightweight web framework, suitable for building RESTful web applications. It is the engine that powers SqueakMap.
HV2 was created by Goran Krampe, and was developed by Goran Krampe and Giovanni Corriga.

http://swiki.krampe.se/gohu/6

License

MIT

Features

URL-based component activation:

How does this work?

Each part of the URL corresponds to a message understood by an HV2 object.

These methods implement the dispatch and response logic of your application.

For example, let's say


No templates:

HV2 uses a builder system to create HTML pages and components.

Instead of embedding code in some kind of page template, you send messages such as
to an HTMLBuilder object that will create the corresponding HTML code.

Automatic form handling: no need to name your forms and the fields within them: HV2 will take care of that. The values of a submitted form may be easily retrieved simply by sending a #value message to right objects. This makes form creation as easy as building GUIs!

Small codebase: the whole framework is just a handful of classes.

Getting started

From SqueakMap install in order


Save the image. :)

Now, fire up HelloWorld - read class comment of HVHelloWorld. All samples can be started/stopped on port 8080 by simple sending "startDebug" or "stop" to the class. You can also stop any running sample by sending "stopAll" to any sample class.


HV2 and Seaside

HV2 exploits the HTTP request/response model that Seaside abstracts away. This makes HV2 well suited for RESTful, asynchronous web applications that don't require an high degree of interactivity, while Seaside is ideal for complex, interactive web applications.
With a little work, HV2 and Seaside may be integrated, giving you the power of both frameworks.

Known Uses


Download

HttpView2 may be downloaded from SqueakMap

Tutorial



Development roadmap


Contacts


See also

WebServer
Teapot micro web framework (Pharo)
Building and Deploying a Small Web application (Pharo)