Link to home
Start Free TrialLog in
Avatar of pcorreya
pcorreya

asked on

get a value from a content string

xmlurl=http%3A%2F%2F127.0.0.1%2Fmydbs%2Fwipdesign.nsf%2FagtGetDocsViewXML%3Fopenagent%26u%3Dc956395%26uname%3DJoe+Blogg%26start%3D1%26count%3D9999%26viewname%3Dfrmgicsissueview%26frmname%3D%26frmtype%3DView&xslurl=http%3A%2F%2F127.0.0.1%2Fmydbs%2Fwipdesign.nsf%2Fviewreport.xsl

I do have a method to decode the content string, however I need a method to pass in this content string and get the values for xmlurl and xslurl.

Thanks
pcorreya
ASKER CERTIFIED SOLUTION
Avatar of vbandaru
vbandaru

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
vbandaru is right, the only additional thing you may want to do is decode the urls:

import java.net.*;

public class extracturls
{
      public static void main(String[] args)
      {
            String contentString="xmlurl=http%3A%2F%2F127.0.0.1%2Fmydbs%2Fwipdesign.nsf%2FagtGetDocsViewXML%3Fopenagent%26u%3Dc956395%26uname%3DJoe+Blogg%26start%3D1%26count%3D9999%26viewname%3Dfrmgicsissueview%26frmname%3D%26frmtype%3DView&xslurl=http%3A%2F%2F127.0.0.1%2Fmydbs%2Fwipdesign.nsf%2Fviewreport.xsl";

            String xmlurl= URLDecoder.decode(contentString.substring(7,contentString.indexOf("xslurl")-1));

            String xslurl= URLDecoder.decode(contentString.substring(contentString.indexOf("xslurl")+7));
            
            System.out.println(xmlurl);
            System.out.println(xslurl);
      }
}
>>vbandaru is right

? So i'm wrong am i? ;-)

In any case, your comment is redundant - you obviously have not read the question:

>>I do have a method to decode the content string, ...
Avatar of pcorreya
pcorreya

ASKER

Thanks you all for your contribution, however it would be nice to have a class that I can use to pass it the content string and the lookup field and return its value.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
objects, i am getting the message Method split(java.lang.String) not found in class java.lang.String
it only became available in 1.4.
you'll need to use StringTokenizer in previous versions.