Your First Stateful Project
So far, we have seen two of the technologies, D2W and ERRest, that Project Wonder offers for viewing and managing the data. In this tutorial, we will show how to do it with the "stateful" way of doing things. Stateful have been around since the beginning of WebObjects in 1996, so it's the oldest way of presenting data and constructing pages.
Stateful means that you don't have to worry about creating sessions and keeping track of data coming from HTML input fields and controls. In fact, D2W is also stateful.
In this tutorial, we are also going to use the Ajax framework, who is stateful too. We will replicate the functionalities of the two other tutorials, but by creating pages ourselves. The application will have the following pages:
- The main page will display a list of blog entries, with a link to see the blog entry.
- The main page will have a link to an "admin" page that will show a login form.
- After login, a list of blog entries with links to edit, delete and create blog entries will be show.
- We need a form to edit/create blog entries.
Let's start by creating a new project in Eclipse. You need to create a Wonder Application project type, and name it StatefulBlog.
Just like the D2W tutorial, you need to link the application with the BlogCommon framework. To do so, right-click on StatefulBlog and select Build Path > Configure Build Path.
In the Libraries tab, click on Add Library. Select WebObjects Frameworks and click Next. Check BlogCommon and H2PlugIn from the list and click Finish. The Libraries tab should look like this: