I am doing a POST
-request using jQuery which seems to succeed. But how can I work with that on server side and modify the response?
Do I need another servlet be
If sending the ajax POST by usual JSF means (UICommand
component, jsf.ajax.request()
, etc, in flavor of
,
,
, etc) is really not an option for some reason left unspecified in your question, then you'd indeed better create a separate servlet or even JAX-RS or JAX-WS webservice listening on those requests and returning e.g. XML, JSON, etc. JSF is a HTML form based MVC framework not a web service framework.
You only need to take into account that you deal properly with JSF view state when you manipulate the HTML representation of JSF components afterwards. E.g. when you use custom JS/ajax to enable a disabled HTML button as generated by
without involving/notifying JSF, then it won't appear as enabled in JSF component state and its action would never be invoked.