I have created an entity person with the fields longitude and latitude and would like to display the instances on google maps. What is the recommended way to create controllers and views manually and access entities?
I have created an entity person with the fields longitude and latitude and would like to display the instances on google maps. What is the recommended way to create controllers and views manually and access entities?
found the solution. Thank you.
The 'controller class' command provides a good starting point when developing custom views. I guess you have seen that command?
Stefan Schmidt
Software Engineer, Spring Roo
SpringSource - a division of VMware
twitter @schmidtstefan
Ben: Since I wanted to access all instances of my entity used
controller scaffold --class ~.view.MyController --entity ~.domain.Person --path mypath --disallowOperations create,update,delete
to create a new controller. I then changed the template under views/mypath/list.jspx.
Regarding the map functionality I simply followed the examples given by google.
Ben: I need to return a list of all instances of my entity person in a format other than xhtml. Is there a way I can reuse the list.jspx file but to define what content type is returned?
You can try Spring ContentNegotiation to return diferent formats of the same data, it works like a charm.
But i donīt understand how you intend to use reuse a JSPX page (wich is a view, not content returned by any controller) to show anything but (X)HTML
Maybe you want for example that with the same java code the url http://myapp/person.pdf returns a pdf file with the same list of persons that you can see in persons.jspx?? if so take a look at Content negotiation, itīs very easy.
HTH