Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting null from FacesContext.getCurrentInstance().getPartialViewContext() while making mock object

Rahul max
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to JSF, I am getting a NullPointerException when I am trying to call FacesContext.getCurrentInstance().getPartialViewContext() from my code.
I am working on testing some module built on jsf, so I build a mock object of FacesContext using myfaces.
My code looks like-

facesContext=new MockFacesContext20();

Please help me with some example...!
Is there a way to initialize a mock FacesContext object with custom PartialViewContext??
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!