As previously mentioned, wedge 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 wedge application has some characteristics that are common to all wedge 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
frame or a
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 wedge 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.
Wedge supports various naming conventions that will allow you to easily create pages and view the result right away.
As wedge 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 wedge:
Wedge 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
wedge 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.
One of most usefull feature of the wedge 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, wedge 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.
As mentioned above , a page is an wedge element and has all the characteristics presented in that section. However, there are still some specific things you need to know about pages.