Vroom is a Java EE web application development framework. It's a great mix of MVC and Ajax-enabled Event Driven Architecture.
Vroom Web Framework you can:
Manage your application contents and resources from a single configuration file typically named as vroom-config.xml and it's placed in /WEB-INF/ folder.
Inject meta tags, scripts, stylesheets to a single or group of webpages identified by webpage element.
Add event handlers for HTML DOM events through vroom-config.xml file where you can scripts and/or update contents of any HTML object including document, window and navigator.
Bind your HTML DOM events to as many server side java bean methods as you need e.g. you can two different java methods on a single click of a button which in turn either call a script or update the HTML contents.
Also bind HTML forms to invoke a specific java bean method when the form submits. The framework automatically populate the corresponding elements so you don't need to extract them using request.getParameter() method.
Control the navigation flow using the navigation element which works somewhat similar to JSF navigation. i.e. if the method that you bind with a form returns an outcome, with the navigation element you can either forward or redirect to a different page.
Use any javascript, dhtml, css enabled client framework such as YUI, Dojo, jMaki. You can invoke java bean methods which can provide data to Ajax services which these frameworks use to build dynamic data model. This eliminates the need of create servlets. In short every java bean is a servlet by default :-)
To enable Vroom to work with jMaki widgets you need to make the following changes in jmaki.js and jmaki-min.js. I don't know how to make changes to jmaki-min.js so I simply overwrite the jmaki-min.js with jmaki.js after making the following changes:
this.addWidget = function(widget) {
if(widget.value.indexOf('document.') == 0) {
this.lazyLoad(widget);
} else {
widgets.push(widget);
if (this.loaded){this.loadWidget(widget);}
}
};
this.lazyLoad = function(widget) {
var _obj = null;
_obj = eval(widget.value);
if(_obj == '') {
setTimeout(function() {
jmaki.lazyLoad(widget)
}, 100);
} else {
widget.value = _obj;
widgets.push(widget);
if (this.loaded){this.loadWidget(widget);}
}
}
In test.jsp I add a widget for example:
In vroom-config.xml file I define the following definition:
document.oStates = "";
In the LookupBean I put the following code:
public class LookupBean {
private List states = new ArrayList();
public List getStates() {
if(states.size() == 0) {
states.add(new LabelValueBean("Alabama", "AL"));
states.add(new LabelValueBean("California", "CA"));
states.add(new LabelValueBean("New York", "NY"));
states.add(new LabelValueBean("Texas", "TX"));
}
return states;
}
}
With version 2.1.5, a limited support for Woodstock theme has been added. This is done because at runtime the html ids of the components changes e.g. "form1:label1" becomes "form1:label1_valueContainer" or "form1:dropdown1" becomes "form1:dropdown1_list". With 2.1.5, the framework automatically locates the component by just providing the ids that are used in JSP. This is implemented for only label, button, textfield, textarea, dropdown, checkbox and radio button. For other components which have different properties to recognize at runtime must be accessed by provide the complete html id assigned at runtime. To determine them the page source code can be analyzed either by viewing the source code from the browser menu or firebug plugin for firefox.
The vroom.js now has an additional method called VroomUtils.generateUrl(method, beanClass, var, scope).
This method is very handy to invoke methods in any public java bean which satisfy the following signature.
public void|Object methodName();
public void|Object methodName(HttpServletRequest req);
public void|Object methodName(HttpServletRequest req, HttpServletResponse resp);
The framework automatically convert the method output to JSON string. E.g.
If the method returns a basic data type such as String, Integer, Long, Float, java.util.Date etc the value is accessed in vroom-config.xml file using #{value} expression.
If it returns a List or Array then #{array} is used.
For Maps, Properties, ResourceBundles and Java Beans #{key} is used where key can be the key of the in the Maps, Properties or ResouceBundles or simple a javabean public property.
Nest objects can also be accessed e.g. if the method returns Map of a Map then #{key1.key2} is used where as key1 is the key in the parent map and key2 is the key of a map which is retrieved using key1.