How to create EMF models from JSP pages ?

Posted on in Blog
The next release of MoDisco (version 0.9) is under development and is planned to be released with Indigo. This release will come with new components for creating EMF models from the source code of JEE applications.

The current version (version 0.8) already provides components for creating EMF models from java source code (see this older post). In next version, new components will be dedicated to JSP reverse-engineering. They have been developped by Fabien Giquel and Nicolas Guyomar of Mia-Software.

They are composed of:
a metamodel for describing a JSPa discoverer for creating a model from a set of JSP pagesa generator for generating JSP pages from a model
The JSP metamodel (defined with Ecore) is an extention of the XML metamodel (also provided by MoDisco) which contains types such as Page, JSPScriptlet, JSPExpression, JSPTagLib, etc.


The discoverer, is a component which analyzes JSP pages and creates an EMF model conforming to the JSP metamodel.

It can be launched from a project, or directly from JSP pages.

The result is an EMF model which can be opened with the MoDisco Model Browser.


The generator allows regenerating JSP files from an EMF model (conforming to the JSP metamodel). While it still needs to be improved to support a better formatting, yet it can already be used to produce JSP files.

With these new components, you can reverse-enginer JSP files and use EMF APIs in order to control coding norms, detect patterns, document existing pages or refactor them by applying transformation at the model level (and then use the generator to get a new version of your JSPs).
Auteur d'origine: Fred