4.2. Wedge Elements

As previously mentioned, application consist a pages, frames and parts (components). In the section to come we will discuss in more detail each of these elements.

Any of the elements that make part of a application has some characteristics that are common to all elements.

Each element has an identifier, an unique name through out the application by which it is identified. Also, it has a type. It can be a page, a frame or a part (component).

Each element must have a backing Spring bean, thus, a java class that will provide the information to be presented in the view.

The pages and the parts (components) supports multiple views. This means that you may define a single page with a single backing bean and with multiple template views. This is a very nice feature in our opinion because this allows easy creation of pages that do need to present the same information in different ways (for instance, a group of views for creating a new item, view its details or edit that item). Also you may want to add a simple confirmation screen with just one question affecting a boolean instance field that will make you decide whether an action should take place or not. For just one screen its just to much to have a whole page defined for it.

For each type of element there is coresponding dedicated package and a folder under the WEB-INF folder in the application's web root. The following tables summrise this convention.

Table 4.1. Wedge Elements Conventions
Type Package Folder
page [app.package.]web.pages WEB-INF/pages
part [app.package.]web.parts WEB-INF/parts
frame [app.package.]web.frames WEB-INF/frames

4.2.1. Using Naming Conventions

supports various naming conventions that will allow you to easily create pages and view the result right away.

As generates and compiles code on the fly it is able to reload pages as they chage or to load them if they were created after the application start up.

Here is a simple scenario that will exemplify how to make use of this reloading capability of :

Reloading Mechanism Process

  • Create simple page or use an existing one then start the embedded Jetty server and open it in a browser.

  • Modify the page template by adding a link to a non existing page: <a linkto="myNewPage" >Go to my new page</a> .

  • Refresh the browser window. You should see the result right way.

  • Create a new page named myNewPage by running the command wedge:page myNewPage in the commandline tool.

  • Click on the link in browser window and you sould see the created page.

  • You may continue this process by adding pages and components. If your web designer already created the templates of your application for you then you may create the application rapidly and without all the stop server/compile/redeploy/start server cycle.

4.2.2. Java Classes Reloading

One of most usefull feature of the framework for the development process is the ability to reload java classes even if they suffered structural changes as method adding or renaming, adding fields, modifiyng the code etc.

In development mode, checks both the java source files for changes and if this occures, the it reloads them. However, it is important to notice that, when reloading a java class its class loader must be throwed way too. This means that all the other pages and components classes will be droped too.

4.2.3. Wedge Pages

As mentioned above , a page is an element and has all the characteristics presented in that section. However, there are still some specific things you need to know about pages.

4.2.4. Wedge Frames

4.2.5. Wedge User Defined Components