views:

80

answers:

1

I'm building a JSF 2 application. I wanted to integrate it with jQuery, e.g.:

$.getJSON(contextPath + '/something', function(data) {
// ...
});

I need contextPath/something to return data in JSON. How can I do it?

I know I can assign another servlet to this URL, but this approach does not seem to scale well. One could use a more scalable approach with a front end controller (e.g. Spring Web MVC), but I really wanted to write this in Java Enterprise stack. What other options are there?