Skip to Main Content

Unable to get a substring of the current page's URL

953975Aug 5 2012 — edited Aug 6 2012
Hi,

I am having a very odd issue with the URL returned by GSF. I appear to be unable to get a substring of the URL - the String.substring(int, int) method does not appear to return the expected results. It appears that other String methods (such as indexOf(String)) appear to be operating on the string that Substring is returning a portion of, rather than the string seen when printing the url in full. The relevant code is below:

-----
AssetApiWraCoreFieldDao wraDao = new AssetApiWraCoreFieldDao(ics);
String wrapperCurrPage = ics.GetProperty("com.fatwire.gst.foundation.url.wrapathassembler.dispatcher", ServletRequest.properties", true);

WebReferenceableAsset wraCurrPage= wraDao.getWra(pageId);
String theLongUrl = new String((new WraUriBuilder(wraCurrPage,wrapperCurrPage)).toURI(ics));

//This prints the correct URL (http://www.example.com/page)
out.println("FULLURL: " + theLongUrl.toString());

//This prints the first 25 characters of some unknown string (satellitescheme://SSURI/?)
out.println("SUBSTRING: " + theLongUrl.toString().substring(0,25));
-----

Any assistance in working out what is going on would be appreciated - as far as we can tell GSF (or perhaps WCS) is causing String to behave in a non-standard way.
This post has been answered by Tony Field on Aug 6 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked due to inactivity on Sep 3 2012
Added on Aug 5 2012
3 comments
255 views