``
element. This is what binds the ``
`` tag to the ``Label`` component
created in the previous section. The value of ``wicket:id`` must match the
id given to the component, in this case "hellolabel".
Create the i18n file
--------------------
With Wicket (and any web application framework), any string that appears in the
web application should be interationalized. In GeoServer, this is performed by
creating an internationalization (i18n) file named
``GeoServerApplication.properties``.
#. Create the (i18n) file ``GeoServerApplication.properties`` in the ``src/main/java`` directory::
HelloPage.page.title=Hello
HelloPage.page.description=A page to say hello
The above i18n file declares two keys, one for the title of the page and one
for the description of the page.
Create the application context
-------------------------------
#. The final step is to create an application context which tells GeoServer
about the page created in the previous section. Create the directory
``src/main/resources`` under the root of the ``hello_web`` module::
[hello_web]% mkdir src/main/resources
#. Add the following ``applicationContext.xml`` file to the
``src/main/resources`` directory, under the root of the ``hello_rest``
module:
.. code-block:: xml
The above bean declaration declares an instance of the ``MenuPageInfo`` class
which is a descriptor for pages linked from the main page of the GeoServer
web application. The property ``titleKey`` is the title of the page and it
receives the value of the title i18n key created in the previous section.
Similar for the the ``descriptionKey`` property.
Test the extension
------------------
At this point, the ``hello_web`` module should look like the following::
hello_web/
pom.xml
src/main/java
applicationContext.xml
GeoServerApplication.properties
org/geoserver/helloweb/
HelloPage.java
HelloPage.html
#. Build the ``hello_web`` module::
[hello_web]% mvn install
#. Copy the ``hello_web-1.0-SNAPSHOT.jar`` file from the ``hello_web/target``
directory into the ``WEB-inf/lib`` directory of a GeoServer installation::
[hello_web]% cp target/hello-1.0-SNAPSHOT.jar /home/bob/geoserver-2.0/webapps/geoserver/WEB-INF/lib
#. Start or restart GeoServer
#. Navigate to http://localhost:8080/geoserver/web
Upon success a link titled ``Hello`` should appear in the menu on the left side
of the main GeoServer page. Following the link brings up the ``HelloPage``
.. image:: test.jpg