How Extract URL ?

hi,
i want to get URL from Browser and want to extract it using java program and using it in JSP page
eg. http://forum.java.sun.com/post!default.jspa?forumID=31
i need to extract with character ?
then
1) http://forum.java.sun.com/post!default.jspa
2) forumID=31
send me code please..

Hi Ghanashyam,
What do u mean by saying that "extract it using a java program". if the program wants to interact with the browser, then it should be a servlet.
anyway one option is
String path=request.getServletPath();Then later use StringTokenizer to split it to "?" marks

Similar Messages

  • How extract a value from table?

    how extract a value only from table with labview 5.0?

    Hi T4l
    I modified you VI to extract a selected row from the table. This is quite simple by done by using the index array function. Hope this helps
    B Bakels
    Labview CLD , Engineer/Manager
    Promedes and DSM
    using LV 7.1, 8.0, 8.2, 8.5 and 2009 SP1
    http://www.promedes.nl
    Attachments:
    Untitled 2.vi ‏16 KB

  • Php extract url's from recordset

    Hello guys,
    I need to extract url images from a recordset (the recodset is an html page) for build a feed.
    To do this I use regular expression to find url and I get the results with print_r function.
    Good, now I need to replace the array key with xml tags, to do this I need to replace the array key with regular expression ?
    I think that is not the best way...

    Hello again, someone know if exist a regular expression generator tool online ?

  • Extract URL from Mail message

    Hello Applescript-Meisters,
    I have the following problem:
    Every week we receive an email which contains a secure URL (https://) with always different username and password to download a ".tar" file.
    Since I'm new to Applescript I tried to extract the paragraph of the email message with the line which contains the URL, but doesn't seem to work:
    tell application "Mail"
    set theMessages to message 1 of mailbox "EXAMPLE" of account "AccountTest" whose subject begins with "Data request"
    set theContent to content of theMessages
    set someData to paragraphs of theContent
    repeat with someData in theContent
    if someData begins with "https://" then
    set theURL to paragraph of someData
    else
    set theURL to paragraph 18 of theContent -- this works but this line can change weekly
    end if
    end repeat
    end tell
    Any help or suggestions would be greatly appreciated.
    Cheers,
    gilles

    The most obvious problem is how you're trying to iterate through the paragraphs.
    You start off with:
    set theContent to content of theMessages
    which is fine - theContent now contains the text of the email.
    You then extract the paragraphs of that text:
    set someData to paragraphs of theContent
    But you then reset 'someData' to be the iterator in a loop:
    repeat with someData in theContent
    Additionally, you're iterating through theContent, which is a single block of text.
    I think what you mean to do is iterate through the paragraphs of theContent, like:
    repeat with someData in (get paragraphs of theContent)
    Once you have this, you know someData is the paragraph you're currently looking at so you can:
    set theURL to someData
    Finally, you do not want an 'else ... set theURL' statement because that will reset theURL every time you find a line that doesn't begin with "https://" (e.g. if paragraph 10 starts with https:// you set theURL to that paragraph, but as soon as you move onto line 11 you reset theURL because the paragraph doesn't begin with https://
    To address this you should just iterate through the paragraphs and only set theURL to paragraph 18 if you didn't find any matching lines.
    Putting it all together:
    set theURL to "" -- default value for theURL
    theContent to content of theMessage
    repeat with someData in (get paragraphs of theContent)
     if someData begins with "http://" then
      set theURL to someData
     end if
    end repeat
    if theURL = "" then
     try
      set theURL to paragraph 18 of theContent
     end try
    end if
    Note that I've included the 'paragraph 18' line in a try block. That's so that the script doesn't fail if there are less than 18 paragraphs in the message (you can't get paragraph 18 of a 17-paragraph document).

  • Extract URL from a href string

    Greetings,
    I am trying to solve a problem (in a specific way) that will lead to the solution for another problem (which is similar).
    I am trying to extract a URL from an HTML <a> tag like this:
    <a href="www.someurl.com">Go to www.someurl.com</a>Can anyone help with the best solution? I've tried it using String.split() and StringTokenizer (which might work for this example), but, for my real problem, they seem quite inadequate. I'm guessing the solution involves some regex but I don't know where to look (and am quite unfamiliar with regex to know how).
    Thank you in advance.

    Actually, I am trying to break down many sections of the URL.
    The URL I am trying to breakdown has a lot of data that I need.
    I guess a better example would be:
    <a href="www.someurl.com" id="url-id-43612">Link Text - data here</a>In my program, I need to grab three things: the href URL, the id, and "Link Text - data here."
    Here is an SSCCE of how I am currently dealing with this:
    import java.util.StringTokenizer;
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    * @author Ryan
    public class htmlparser {
        public static void main(String[] args) {
            String str = "<a href=\"www.someurl.com\" id=\"url-id-43612\">Link Text - data here</a>";
            str = str.replaceAll("<a href=\"", "\n")
                .replaceAll("\" id=\"url-id-", "\n")
                .replaceAll("\">", "\n")
                .replaceAll("</a>", "\n");
            StringTokenizer tokenizer = new StringTokenizer(str, "\n");
            String url = tokenizer.nextToken();
            String id = tokenizer.nextToken();
            String text = tokenizer.nextToken();
            System.out.println(url);
            System.out.println(id);
            System.out.println(text);
    }But I am looking for a more elegant solution to the problem, is there one?

  • Extracting URL From Application Object

    If I type http://mymachine.com/myapp?a=aaa&b=bbb in my browser (to access application "myapp") how do I extract just the http://mymachine.com/myapp part from the application object? I would have figured that the code below would allow me to construct that string but these methods instead return the stuff in comments...
    URL theURL = application.getResource("/");
    theURL.getProtocol(); // jndi
    theURL.getHost(); // null
    theURL.getPort(); // -1
    theURL.getFile(); // org.apache.naming.resources.FileDirContext@!8bf135
    URL theURL = application.getResource("/myapp");
    theURL.getProtocol(); // null pointer exception
    theURL.getHost(); // null pointer exception
    theURL.getPort(); // null pointer exception
    theURL.getFile(); // null pointer exception

    tech note... HttpUtils is depricated for newer Servlet APIs (2.3+). Instead, you would use the same methods in the HttpServletRequest:
    URL theURL = new URL(request.getRequestURL().toString());

  • Open Hub: How extract Real Data and Header Data in the same .CSV?

    Hi guys, I need to extract the ODS data (I'm on BW 3.5) to a flat file. i thought about using Open Hub Service, but in SAP Help info I found that it generates 2 files: One with real data from ODS and the second is a Meta Data file with Header (names of the columns...etc)
    I need generate one file with the first row being a header, do you know how could I do it??
    Thank you and Cheers?

    Could you give me an example of this update rutine?

  • How extract a custom site-collection templates from Central Administration (SharePoint 2007)

    In our company installed SharePoint 2007. On the tab "Create site collection" in the Central Administration we have a custom template (for russian language), which has been installed by previous developer. There is no documentation or installation
    file about this template. 
    Please suggest how i can extract this template (installation file) from Database? We make a migration to a new server and i need install this one more...

    we need to extract using visual studio
    Once you have the .stp file, you can change the .stp file extension to .cab file
    http://sharepoint.stackexchange.com/questions/53095/visual-studio-project-template-to-extract-sharepoint-list
    http://www.pearsonhighered.com/samplechapter/0321336615.pdf

  • Help extracting URL's from PDFs I create

    Using Acrobat pro 9.+ I have several PDF catalogs I have created, and what I need t
    o do is extract the URL's for each 100 page catalog.
    These are added URL's using the Acrobat linking tool
    Ideally they would be one URL per row, and have at least a minimum amout of information.
    1. URL
    2. (if possible, the page the URL is from)
    Thank you

    maybea two step process? one applescript that extracts to a text file, and then an automator that can read that file (can autoamtor read froma  text file?) and do what you want?
    Jason

  • How set Url path in include .css or .js

    Dear Pakar
    i have .css with content below
    #pageWrapper {
         /*background: #5b93cc;*/
         background:#999999;
         background-image:url(/image/background.jpg);
    how to set url directory in apex style directory ?
    Thanks
    Imansyah

    Hello Imansyah,
    If the JPG is on your application server in the (virtual) /i/ directory (referencing the /images/ directory of APEX), you should try:
    #pageWrapper {
    /*background: #5b93cc;*/
    background:#999999;
    background-image:url(/i/background.jpg);
    }Regards,
    Roel
    http://roelhartman.blogspot.com/
    http://www.bloggingaboutoracle.org/
    http://www.logica.com/

  • Extract URL from HTML text

    Suppose you have the following String that is body text with HTML.
    String bodyText = " My name is Blake. I live in New York City. See my image here: <img href="http://www.blake.com/blake.jpg"/> isn't my picture awesome? Tata for now!"
    I want to extract the URL that contains the location of the image in this bodyText. The ideal would be to create a function called public String extractor(String bodyText) to be used
    String imageURL = extractor(bodyText);
    //imageURL should be "http://www.blake.com/blake.jpg"
    My first thoughts are using reg exp, yet the place i would find to use that would using the .replace in String class. I am by no means an expert on reg exp so I haven't taken too much time to try to figure it out with reg exp. I obviously could do a linear search of the bodyText and do a ton of if statements, but thats just poor coding. I want see if anyone came across this or has insight to this problem.
    Thanks for all the help,
    Blake

    How would the regexp change if there were multiple img tags within the String.I don't rightly know, I'm just a raw beginner in regexes.
    Would this regexp return all the img URLs found in the String.No, as it stands it would return only the last URL. But this will:String bodyText = " My name is Blake. " +
          "I live in New York City. See my image here: " +
          "<img href=\"http://www.blake.com/blake.jpg\"/>" +
          " isn't my picture awesome? Here's another: " +
          "<img href='http://www.blake.com/Vandelay.jpg'/>" +
          " Tata for now!";
    String regex = "(?<=<img\\shref=[\"'])http://.*?(?=[\"']/?>)";
    Pattern pattern = Pattern.compile (regex);
    Matcher matcher = pattern.matcher (bodyText);
    while (matcher.find ()) {
       System.out.println (matcher.group ());
    }Note the enhancement that takes into account that both single and double quotes are legal in HTML. But unlike the earlier example, this does not tolerate more than one space between <img and href=, I couldn't find a way to achieve that.
    Visit this thread later, there are some real regex experts around who may post a better solution.
    db

  • Extracting URL of the plugin opened from browser

    An attachement is uploaded to the server page. Now when we open the attachement , the browser opens a Winword plugin for opeening it in a new window . Further the complete URL of the attachement along with the object-identity number is displayed in the title barof the new window. How do i get the complete URL present in the title bar??

    you don't. ... If the content is not HTML and it's the only content loaded in the page, you have no way to control anything about that window. Even with Javascript from another window, you can't cuz there's no way to get a reference to the window to do anything.

  • How extract data from case structure

    Hi all, I would like to extract the data from case structure, it's circled in red in the attached file. How should I do it? Thanks for taking your time to look at my post. Your help is greatly appreciated.
    Attachments:
    bp.jpg ‏161 KB

    Thank you guys for your prompt reply.
    As u can see from the vi, there's an error, I need the values in the circled area to be passed on to the block ( Bundled by name)
    Thanks !
    Attachments:
    fyp_bp_only.vi ‏90 KB
    fyp_bp_only.vi ‏90 KB

  • Auto-extracting URL LINKS from webpage?

    is there a way to extract all the linked url's from a webpage?
    i am trying to put together some lists and would like to gather these up and then insert them into a numbers spreadsheet. in some cases there are 30 to 50 of these listed on the left hand side of a webpage and right now I imagine clicking on a link, copying the url from the browser, inserting into  numbers, clicking back, clicking on the next link etc.
    is there a way to save some steps by exporting these to a text document and then copying and pasting from there?
    thanks for any help.

    You create the new bookmark with the javascript replacing the original URL from any old bookmark you have and no longer need, or just create a new bookmark for any thing at all specifically for your links script. Then once you are at a page where you want the links displayed, you just select your new links bookmark. Your page will stay open, but a new window will open as well, with all the links listed. You might want to change the size of the window, the width=400 and height=200 result in a pretty small window. Anyway, I put the Links javascript bookmarklet in my Bookmarks menu, so while I am here on this page I just go to the Bookmarks menu, slide down and select Links, and a new window opens with all the links on this page listed.
    Francine
    PS--It would be more impressive if I had written that script, but I didn't. I found it years ago and saved it with a batch of bookmarklets that do other useful things, such as suppressing animated gifs. I just checked, and a particularly useful collection, Jesse's Bookmarklets, still exists:
    https://www.squarefree.com/bookmarklets/

  • How extract data from bw cube to MS SQL server.

    Hi all,
           This is Sateesh.In my requirement, i need to extract date from  BW Cube and to be moved to MS SQL server.can any one give  the slution .Pls give me the process how to move from bw to sql server.

    HI Kumar,
                       Try with Open Hub.........
    Check these.....
    http://help.sap.com/saphelp_nw04/helpdata/en/66/76473c3502e640e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c5/03853c01c89d7ce10000000a11405a/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/59/90070982d5524b931ae16d613ac04a/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ce/c2463c6796e61ce10000000a114084/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/43f92595-0501-0010-5eb5-bb772d41ffa4
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e830a690-0201-0010-ac86-9689620a8bc9
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5f12a03d-0401-0010-d9a7-a55552cbe9da
    http://help.sap.com/saphelp_nw04/helpdata/en/66/76473c3502e640e10000000a114084/frameset.htm
    /people/happy.tony/blog/2006/09/18/hyperion-essbase-data-extraction-transformation-and-loading
    /people/marc.bernard/blog/2005/07/11/reorganization-of-sap-business-intelligence-forums
    Using OpenHub Unix to export to SQL Server
    Infospoke
    HOW TO RETRACT DATA FROM BPS 7.1 TO SRM 5.0
    Regards,
    Vijay.

Maybe you are looking for

  • Is it possible to reinstall Symbol dfont into the system folder?

    Since updating to Snow Leopard, there is no Symbol dfont in the system folder. I have been relying on this font for sometime now to avoid special character issues. I use InDesign and this font has become essential for my work. The Symbol font now sup

  • Form Requirements ?

    Hi, I have created a Travel Expense form using LiveCycle Designer 7.0. Currently we have Acrobat Standard 6.0 and when you try to open this form (the one I created using 7.0) up it prompts user saying that you need to update to newer version in order

  • IPad mini microphone. Help!

    I have a new iPad mini and my only problem is the microphone. Its sensitivity is very poor. Facetime and Skype calls are impossible. What can I do?

  • Solaris hangs after reboot on HP DL160

    Hi, my HP DL160 runs fine with Solaris 10, but you can't do a soft reboot, because it won't boot Solaris after that (hangs after loading kernel). I think it's because of a ATA Bug, but nothing has helped to solve the problem (done the ata-revert-to-d

  • Avoiding battery overheating when using MBP in the sun

    Are there any ways to keep a MBP battery cool when using it outside in the sun? Or should I just not worry about it? Today I was sat on my balcony enjoying the Mediterranean sun using my 2014 MBP when Coconut Battery popped up with a notification war