Archive for February, 2014

Jboss / Wildfly maven plugin to deploy on localhost/remote server

This is a very simple solution, that unfortunately took me a couple of hours because I couldn´t find it anywhere…

Place your server properties in the maven settings.xml file (found in the .m2 folder) like this:

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns=""






In the pom.xml file place the plugins under build>plugins> and set the server configuration parameters as maven properties (without adding the in your pom):

<!-- 						<phase>package</phase> -->
<!-- 						<goals> -->
<!-- 							<goal>deploy</goal> -->
<!-- 						</goals> -->

To deploy on the localhost server run the following command:

wildfly:deploy -P wildfly-local

To deploy on the remote server run:

wildfly:deploy -P wildfly-remote

You can also run undeploy, redeploy…For further information see:

Monitoring log files on Windows (64 bit) with mTail

After trying without success the Monitoring plugin for Notepad ++, Windows powershell, I have finally found this:

Thank god, I can finally monitor the server log files properly on the bloody Microsoft Windows!

On the top on the right there is a button that allows you to clear the monitor… very useful!

Primefaces dialog framework: how to make it work

If you have tried some primefaces features, you have probably noticed than some of those pretty things in the official showcase don´t work straight and easy in the application you´re developing. The problem is that even the latest 4.0 version is bugged.

I have been trying to use a Dialog Framework, but there´s something missing from the JqueryUI library and I have found out that the only way to make it work was including an external one, like:

There´s something missing from the JqueryUI library and I have found out that the only way to make it work was including the jqueryUI library (with the h:outputScript component).

<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<html xmlns=""

<title>Enter Product Mapping</title>

<h:outputScript name="js/jquery-ui-1.10.4.custom.min.js"/>

<p:commandButton value="Map"
actionListener="#{managedBean.showDialog}" />


Importing the jqueryui library is the only way to let the browser find the dialog properties (like “draggable”, “resizable”, “width”…). So I could make the following method work:

public void showDialog(){

Map<String,Object> options = new HashMap<String, Object>();
options.put("contentHeight", 340);
options.put("height", 400);



It will open the dialog that you need to put in another page (in this case the dialog.xhtml file):

<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<ui:composition xmlns=""
<title>Enter Product mapping</title>
<h:form id="form">

<h:panelGrid id="grid" columns="3">

<f:facet name="header">
<p:messages for="query" />

<h:outputLabel value="Username" />
<p:inputText id="username" value="#{managedBean.userName}" />
<p:message for="username" />

<h:commandButton value="Save" id="btn" process="@form" actionListener="#{managedBean.updateDialog}" />




The actionListener refers to a method in the managed bean class, that will process the submitted form.

To make it work you also need to add some properties in the faces-config.xml:








Some Eclipse shortcuts

ctrl + + = move to problem

ctrl + E = find file in editor

ctrl + Q=  go to the end of the method

ctrl + shift + T  = find item

ctrl + shift + R = open resource

ctrl + shift + E= switch to editor

ctrl + O = find method

ctrl + shift + arrow up/down = jump method

ctrl + L = go to line

ctrl + alt + H = hierarchy

ctrl + shift + G = find usages

ctrl + t = implementation hierarchy

alt+R= run (opens menu from the menu bar)

alt + shift + R = refactor

alt + shift +S = open source window

ctrl + M = maximize window

Ctrl+Tab=change editor

alt + <- or alt + -> = navigate code

And last but not least… ALT+F5 = update Maven Project (VERY useful!)