Accessing FacesContext from Web Service

Posted by scriptmonster on Stack Overflow See other posts from Stack Overflow or by scriptmonster
Published on 2010-04-21T15:43:50Z Indexed on 2010/04/21 17:23 UTC
Read the original article Hit count: 298

I'm developing a Web Service which will be called by clients which are written by me. In the web service I need to use application-wide objects which eases the load of application on the system. I have implemented my application-wide objects as shown in this question.

I can use my object in a jsf page with no problem as follows.

MyObject mo = (MyObject) FacesContext.getCurrentInstance().getExternalContext().getApplicationMap().get("MyObjectsName");

But when it comes to use it in a Web Service Request FacesContext.getCurrentInstance() returns null. Is there any way to use the FacesContext in a web service.

© Stack Overflow or respective owner

Related posts about jsf

Related posts about application-wide