Clone wiki

specter / views


At the moment, the only accepted format for a view is jsp files. The way of registered a view is quite simple. The class SpecterInitializer, which by the way is a Servlet, has an initialization parameter called viewLocationRootPath, which main goal is to contain the relative path from where the framework should start scanning for files of the type mentioned above. After finishing the scanning process, all previous matched views will be registered in the application for its further use as follows:


If you go back to controllers explanation, you'll see that the return value for the handler consists of a string that matches the nomenclature exposed above. In our example, the view 'users/create', when referenced, it will be translated into viewLocationRootPath/users/create.jsp.

As simple as that!!