14 May
2012
14 May
'12
9:52 a.m.
Hi All, i created a space i.e MySpace1. On WebHome, i put the some content i.e "This is my latest content". Now in my java class, i want to get the content of MySpace1.WebHome page . Here is the code snippet i tried to get the content of page but i get the document1 as null though the page exists. com.xpn.xwiki.api.XWiki xwikiApi= new com.xpn.xwiki.api.XWiki(context.getWiki(),context); Document document1=null; try { document1 = xwikiApi.getDocument("MySpace1.WebHome");// getting document1 as null } catch (XWikiException e) { log.info("did not find OrgDataCreation.WebHome page"); } String contentStr=""; if(document1!=null) { contentStr=document1.getContent(); } I am not sure what i am missing here?