fredag 22 januari 2010

Server Side Code

First try with a custom plankton app has succeeded. How to extend plankton and make your own server logic:

Start your java project. Include the plankton.jar library. In your app, import com.plankton.*. Create a new WebServer object. That's basically it. But that doesn't do anything more than running the plankton webserver on it's own.

To insert your own server logic - create a new class that extends com.plankton.WebPage, let's call it myapp.TestWebPage. Do something in the class, let's just write something to the page in the constructor of the class:

write("hello world");

Then, last step to attach it to a plk-file. Add the class reference to the initial <plk> node:

<plk template="template.html" class="myapp.TestWebPage">
... your design ...

Done. Run your app. Surf to your .plk page and the text "hello world" will be printed before any content in the file. My example here

http://worldofcreeps.com:443/plankton.plk

The text I wrote from my custom class is "I'm running the PlanktonTest!!!"

måndag 18 januari 2010

New Times

Nose To Nose

There has not been much development since the summer. I have my reasons. However, just recently I dusted off the old code. I have started to write a new webserver, for now called "Plankton". It is going to be a real lightweight and easy to start/use application for anyone who wants to run a small web without huge memory-and-process-consuming server applications, learning curve and tons of configuration options.

My thought is to also use Plankton for the World of Creeps, replacing the current tomcat/jsp setup. If this works as I intend, I will get rid of an application layer and in the same time make it much faster to develop since I won't be having the trouble with transferring live objects from one java-process to another (The running world -> Web app on tomcat). Web server and world will be the same running application.

The first test with Plankton v0.1b is running on port 443
http://worldofcreeps.com:443/