Question

I have created a spring roo application with 3 entities. Respective controllers, jsp/views with pagination are generated by roo which is working fine.

Then I have developed a custom service to process data read by above entities. Custom Service is used for processing data (e.g. data quality) to create an ultimate data view for clients.

I want to know how to develop a custom controller to read data from custom service (which returns util map) and create a new custom jsp to display map keeping look and feel including pagination same as all other default pages generated by roo.

Regards, Amber

Was it helpful?

Solution

Maybe you'd rather to create a new Controller to put in it the call to the service in order to show the result in a separate page.

Try the web mvc controller command:

web mvc controller --class ~.web.CustomServiceController --preferredMapping /process/data

It also creates an index.jspx with an entry in menu.jspx

Then add the call to the service in this new Controller:

modelMap.put("data", this.myInjectedService.processData());

And later show the result in the page:

<c:forEach items="${data}" var="data">

Finally, you could manage the secured access if you has configured Spring Security:

<intercept-url pattern="/process/**" access="hasRole('ROLE_ADMIN')" />

From the Roo documentation

The web mvc controller command is different from the other two controller commands shown above. It does not generate an ITD with update, create, delete and other methods to integrate with a specific form backing entity. Instead, this command will create a simple controller to help you get started for developing a custom functionality by stubbing a simple get(), post() and index() method inside the controller

OTHER TIPS

You must push-in the Controller methods you want customize and modify them as needed: call Server or whatever you need.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top