PrimeFaces brings desktop terminals to the web, p:terminal is an ajax powered JSF component to execute commands defined on server side. Usage is very simple, just place the terminal and provide a command handler.
<p:terminal commandHandler="#{mybean.handleCommand}" />
CommandHandler is a simple java method taking two parameters, first one is the name of the command and second parameter is an array of command arguments.
public String handleCommand(String command, String[] params) {
if(command.equals("greet"))
return "Hello" + params[0];
else if(command.equals("date"))
return new Date().toString();
else
return command + " " + not found;
}
Terminal in Mock OS X
I’ve integrated terminal to famous PrimeFaces Mock OS X, there’s a terminal icon in the dock displaying the terminal in a dialog. Check out the terminal in Mock OS X demo. CommandHandler is the one I’ve posted above with greet and date commands.
More Demos
There’re two more terminal demos;
* Terminal in a dialog
* Full page Terminal
Aim of PrimeFaces is to create the Ultimate Component Suite to rule them all. What PrimeFaces has so far is just the beginning.

October 21, 2009 at 9:49 am
İs there any wrong with handleCommand method, Cağatay?
Two same condition check?
if(command.equals(“date”))
3.
return “Hello” + params[0];
4.
else if(command.equals(“date”))
October 21, 2009 at 10:19 am
Fixed
October 21, 2009 at 2:47 pm
Oh, WoW, That is neat. I am going to have to try it.
November 3, 2009 at 9:47 pm
[...] finde ich das Terminal:Web Based Ajax Terminal Ich habe leider nur noch keinen Anwendungfall erfinden können um das einzusetzen [...]