JQuery Integration with JSF

I have a JSF application that mainly uses Richfaces. I would like to introduce a more feature-rich network control, for example, jqgrid . Is it possible to get JSON data from JSF bean support? If not, is there an alternative approach?

+3
source share
2 answers

There may be several options.

  • The Bean method can return a string that is nothing more than a JSON string.

    public String getSearchResult(){ 
         results = SearchService.getResults();
         return JsonHelper.convertToJson(results);
    }
    

    You can use JsonLib to convert Java objects to Json.

  • Use a different servlet to serve grid requests

    . , JSon, JSON, JSF. , jQuery, JSF. JSF , JSF . . , . , .

  • JSF Phase Listener, Json Response.

,

+3

JAX-RS REST, JSON. JAX-RS JSF Java EE 6. , JEE6 (CDI) JSF beans, JAX-RS - JSF bean @ .

0

Source: https://habr.com/ru/post/1709251/


All Articles