JSF 2.0 Source Code Comment

1 comments
Commenting in JSF 2.0 looks just like commenting in HTML, so you need to write something like this: <!-- this is the comment -->. By default, Facelets xml parser will include your comment in a generated HTML file, so for a file like the one below:


Facelets xml parser would generate the following output:


If you don't want to include comments in a generated HTML file, you need to add the following context-param node to your web.xml file:


With javax.faces.FACELETS_SKIP_COMMENTS, the generated file looks like that:

How to start Jetty 9 on a custom port ?

0 comments
By default, Jetty 9 starts on port 8080. If you want to change it add jetty.port argument to Jetty start command:
java -jar start.jar jetty.port=80

In the above example Jetty starts on port 80.

How to set up Subversion client proxy ?

0 comments
To set up Subversion proxy go to %APPDATA%\Subversion directory on Windows or to ~/.subversion directory on Linux and edit the servers file. Put the following content to this file (under global section):
[global]
http-proxy-host = proxy.example.com
http-proxy-port = 8080

http-proxy-host is a proxy server (in this example it's proxy.example.com). http-proxy-port is a proxy port (in this example it's 8080). Additionally, you can also set up http-proxy-username and http-proxy-password in the same section, if you wish.

Implementing a TODO list application in Hibernate 4.0.1 and EclipseIndigo for JBoss 7.1 AS

2 comments
If you've read my previous post from the series From Zero to PrimeFaces Hero on JBoss 7.1 with Hibernate, MySQL, Eclipse Indigo and JBoss Tools, then you know that I have already explained how to configure your environment for development of JSF/JPA application on JBoss 7.1. I have also showed how to design a domain model for a TODO list application. This application will now be implemented by using Eclipse Indigo, Hibernate 4.0.1. This really simple example is intended to explain how to build a CRUD application in PrimeFaces 3.5, Hibernate 4.0.1, Eclipse Indigo and JBoss 7.1. We will also synchronize our JPA entities to create them in a database. I am going to use MySQL 5.5, so that MySQL JDBC driver is required. Since there is quite a lot to do, I've prepared a plan of tasks to perform, which is presented below:

  1. Configure your environment and create TODO_EAR (EAR project), TODO_EJB (EJB project) and TODO (Dynamic Web Project) in a way I've described in this post.

  2. Prepare your web.xml file and add JBoss 7.1 Adapter to your Eclipse Indigo in a way I've described in this post.

  3. Install MySQL Server 5.5.

  4. Create MySQL Server 5.5 database for our TODO application.

  5. Download and setup Connector/J (JDBC MySQL Driver)

  6. Add JPA 2.0 capabilities to your Dynamic Web Project, so that you are able to synchronize entities classes with tables in MySQL database server from Eclipse Indigo.

  7. Configure persistence settings (persistence.xml).

  8. Implement Hibernate entities.

  9. Synchronize Hibernate entities with database tables.

  10. Setup MySQL Driver as JBoss 7.1 AS module.

  11. Define Datasource.

  12. Deploy EAR on JBoss 7.1 AS. I've already explained how to deploy EAR unit in this context here.

How to completely remove MySQL 5.5 Server on Ubuntu Linux ?

1 comments
The fastest way to remove MySQL Server on Ubuntu Linux is to type the following command in your terminal:


The first command removes software packages, while the second data directory.

Designing a domain model for a TODO list application

0 comments
As I promised in my previous article this one will be about designing a domain model for a TODO list application. Then, We will implement this domain model in Hibernate, make Primefaces user interface, configure MySQL database and deploy this application on JBoss 7.1 AS. The first thing we need to do is to define requirements for our application. Then we will go through designing a database diagram and UML class diagram for application models. To create UML diagrams I am going to use ArgoUML open source modeling tool which runs on Java platform. In order to design a database diagram I am going to use data modeling functionality included in MySQL Workbench.