Reference Manual for Gracelets - 2.0.0.RC2SourceForge.net Logo
3.1 - Examples : Examples
In this section you will find example applications. Each one will attempt to highlight a particular aspect, feature or benefit of Gracelets.

The example code is taken directly from the live examples shipped with Gracelets Server, so if you want to see the code in action you can download Gracelets server.

When running the examples in the Gracelets Server we have a copy of HSQLDB shipped with Gracelets Server and it is using the JPA extension with an in-memory database already setup. The persistence.properties for our setup is as follows:

WEB-INF/classes/persistence.properties
provider.class = org.hibernate.ejb.HibernatePersistence

connection.driver = org.hsqldb.jdbcDriver
connection.url = jdbc:hsqldb:mem:demodb
connection.username = sa
connection.password =

hibernate.dialect = org.hibernate.dialect.HSQLDialect
hibernate.c3p0.min_size=5
hibernate.c3p0.max_size=20
hibernate.c3p0.timeout=1800
hibernate.c3p0.max_statements=50
hibernate.cache.use_query_cache=false
hibernate.cache.use_second_level_cache=false
hibernate.hbm2ddl.auto = create-drop

gracelets.name=demodb
gracelets.scope=conversation
For now there are two examples:

My Blog Example
The following example is a simple blog example. It will give you an idea of just about how much you can do in a single script. It allows you to add blog entries, add comments to those entries, view blog entries either in the app or with a perma link.


User Manager Example
If the perl/php style of coding is not your preference or you are doing something that will get big and required detailed maintenance, you can still code in the MVC style and yet have the power of Gracelets inside your controllers as well as your view scripts. This example will demonstrate this.