Hi All,
I am facing a problem with getUrlPrefix() method of the RequestContext object.
case(i)
It is working fine for the component preview and even in the case of
adding the component to a page and for the preview of that page as well.
The value it returns is: '/iw/cci/meta/no-injection/iw-mount/default/main/GE-Money/www-ecocard-com/WORKAREA/Content/'

Case(ii)
But once i generate the html of that .page file from one of the Teamsite's tabs Livesite -->GenerateHTML , the method getUrlPrefix() is returning just '/' instead of the above value.

I am using it in the following code to get the name of the work area dynamically.
public Document getNewsXML(RequestContext context) {
String urlPrefix = context.getUrlPrefix().substring(0,(context.getUrlPrefix().length()-1));
String currentWorkArea = urlPrefix.substring(urlPrefix.lastIndexOf("/"));
.....................
}
Since , in the case(ii) , the value is just '/', it is throwing java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1762)
at java.lang.String.substring(String.java:1735)
..........................
..........................
..........................
I am calling the above method from the content XML as shown below.
[HTML]
com.interwoven.livesite.gemoney.NewsXML
getNewsXML
[/HTML]
Can any one please let me know how can i solve this? Thanks in Advance.
Regards,
Anjani Kumar