Dynamic Web Development with Seaside

2.4.5Registering as a Seaside Application

We will now register our component as an application so that we can access it directly from the web browser. To register a component as an application, we need to send the message register:asApplicationAt: to WAAdmin.

WAAdmin register: WebCounter asApplicationAt: 'webcounter' will register the component WebCounter as the application named webcounter. The argument we add to the register:asApplicationAt: message specifies the root component and the path that will be used to access the component from the web browser. You can reach the application under the URL http://localhost:8080/webcounter.

Use World | Workspace to open a workspace, which is an area where you can run snippets of code. Type the text shown above, then select it with the mouse and bring up the context menu and select Do it (d), alternatively use the keyboard shortcut.

Register a component as an application from a workspace

Now you can launch the application in your web browser by going to http://localhost:8080/webcounter/ and you will see your first Seaside component running.

If you’re already familiar with HTML, you may want to look at the introduction to halos in Section 7.2 to learn a little more about how to investigate what’s happening under the covers.

Copyright © 19 March 2024 Stéphane Ducasse, Lukas Renggli, C. David Shaffer, Rick Zaccone
This book is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 license.

This book is published using Seaside, Magritte and the Pier book publishing engine.