If you just want a Smalltalk code to be executed and the current page is not changed when a new url is entered then I dont know if it is possible and I guess it should be done using the normal way like in the counter example.
But if you dont mind page reloading then just create a controller named "add" in your application class like this:
add [
<category: 'controllers'>
counter := counter + 1.
^pageContents
]
Canol Gökel