3.2. How to configure

Each component is declared as a Spring managed bean. Although this is not totaly visible and they are not declared in the usual place, in the end they get registered as Spring manged beans. This thing has an wide range of implications which we'll explore to some extent in the following sections.

Page, parts (components) and frames, each have their own declaration elements. But this elements supports the same attributes and subelements as a Spring bean declaration element. Thus you can configure them just like any other bean by specifing any of the attributes or subelements you would specify in a usual Spring bean.

[Note] elements are not singletons!

This is a very important thing to remember. As this beans are used for displaing information into a web page which may be viewed by several users in the same time you can not declare them as being singletons (which is the Spring default). Actualy, when loading the coresponding bean definitions, the framework declares them as not singletons.

Although we'll talk about pages in particular, much if not all is also true for parts (components) and frames. When will be the case we'll note the differences.

Here is a simple application context configuration:

Example 3.1. Basic Wedge Application Configuration

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xmlns:wedge="http://wedge.sourceforge.net/schema"
	   xsi:schemaLocation=
             "http://www.springframework.org/schema/beans 
              http://www.springframework.org/schema/beans/spring-beans.xsd
              http://wedge.sourceforge.net/schema
              http://wedge.sourceforge.net/schema/wedge-spring.xsd">

    <wedge:application 
    		package="wedge.test" 	1
    		reload="true" >			2
		<wedge:page 
			name="home" 			3
			class="web.pages.Home" 	4
			/>    	
    </wedge:application>
	
</beans>

1

The name of the base package of your application. Full qualified names will be computed by useing this name as prefix.

2

If true, the templates and the java classes are reloaded when they change on disc.

3

(required) The name of the page. It will become the name of the spring bean associated

4

(optional) The class of the wedge page. It may be deduced from the page name: [base package].web.pages.[PageName]