URL Writer Question

Hi everyone,
how can i retrieve information that are only between <body> </body>tags using urlwriter.Thanks!Currently what i know of is as below...
String addine = request.getParameter("id");//get url from previous page
URL search1 = new URL(addine);
     BufferedReader in = new BufferedReader(
                    new InputStreamReader(
                    search1.openStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
}

Use nekoHTML parser[1] on the data received from website. It creates the
DOM tree. From the DOM tree you can get the tag value of body.
[1] nekoHTML parser: http://www.apache.org/~andyc/neko/doc/html/

Similar Messages

  • Jdbc.url newbie question

    Hi there,
    Apologies for this very begginerish question.
    I have been working with oracle in college for the last year. Have been conecting from java using these settings
    jdbc.driver=oracle.jdbc.driver.OracleDriver
    jdbc.url=jdbc:oracle:thin:@nc-oracle-2.students.collegename.ie:1521:orcl
    jdbc.username=username
    jdbc.password=password
    I am trying to finish up project at home for the weekend and have installed oracle 9.20.10.
    I am not sure what these settings should be or how to find out. I have user name and password set up and can work away in sqlplus. How do I find out what the jdbc.url is?
    Thanks in advance
    stuart.

    thanks, I ran those commands and now have this
    jdbc.url=jdbc:oracle:thin@localhost:1521:stuart
    When I run my app I am getting this message:
    java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
    Any suggestions?
    Message was edited by:
    newbie101
    Message was edited by:
    newbie101
    Message was edited by:
    newbie101

  • Java.nio read/write question

    Hello,
    I just started to learn the java.nio package so I decided to make a simple Echo server. I made a client which reads a line from the keyboard, sends it to the server and the server returns it. It all works except one little detail. Here's little code from the server:
                                 int n = client.read(buffer);
                                 if ( n > 0)
                                     buffer.flip();
                                     client.write(buffer);
                                     Charset charset = Charset.forName("ISO-8859-1");
                                     CharsetDecoder decoder = charset.newDecoder();
                                     charBuffer = decoder.decode(buffer);
                                     System.out.println(charBuffer.toString());
                                     buffer.clear();
                                  }So that works, I send the data and then I receive it back. But only for the client. I also wanted the server to print the line which is the reason for the charset and the decoder. The above code however prints only a blank line. Thus I tried this:
                                 int n = client.read(buffer);
                                 if ( n > 0)
                                     buffer.flip();
                                     Charset charset = Charset.forName("ISO-8859-1");
                                     CharsetDecoder decoder = charset.newDecoder();
                                     charBuffer = decoder.decode(buffer);
                                     System.out.println(charBuffer.toString());
                                     client.write(buffer);
                                     buffer.clear();
                                  }Or in other words I just moved the write() part downwards. So far so good, now the server was actually printing the lines that the client was sending but nothing was sent back to the client.
    The question is how to make both, the send back line and the print line on the server side to work as intended. Also a little explanation why the events described above are happening is going to be more than welcome :)
    Thanks in advance!

    Strike notice
    A number of the regular posters here are striking in protest at the poor
    management of these forums. Although it is our unpaid efforts which make the
    forums function, the Sun employees responsible for them seem to regard us as
    contemptible. We hope that this strike will enable them to see the value
    which we provide to Sun. Apologies to unsuspecting innocents caught up in
    the cross-fire.

  • How to write questions in the databese.

    Hi friends,
    I am making a project in java on online exam but the problem is that i dont understand how to enter long questions into the database so that it will be easy to store and read that questions back.
    For example i want to write following question in c and correstponding 4 options in the database.
    main()
    int i=-1,j=-1,k=0,l=2,m;
    m=i++&&j++&&k++||l++;
    ("%d %d %d %d %d",i,j,k,l,m);
    If questions are more an too long it is difficult to read that questions.So how can i solve this difficulty.
    Please,reply as soon as possible.
    Thanks.

    Are you, is he.. talking about Java or C? Is he refering to database querys and procedures? Is his code meaningful?
    To me at least, your question is not clear at all.
    Mel

  • File Read/Write Question

    Hello Everyone, nice to see a large Flex user group.
    I am a beginner to flex and I have a simple question. I am
    currently writing a web application in Flex. I compute some data
    and all I want to do is take this string and write it to a file on
    the local disk. In other words, writing some data to a location on
    the disk. Please note that this is a web application. I did some
    searching and could not find anything that works...since it is a
    flex web application they have some tight security. I am guessing
    we might need some help from javascript or something but do not
    know how to do that. If anyone could help me with this it would be
    really helpful. Thanks.

    This is correct - web apps cannot write to the local disk.
    Imagine you went to a web site that has a banner SWF and that SWF
    was written to open a file on your disk and fill up your disk
    drive. Or perhaps worse, the SWF opens a file and reads your
    personal and financial information. You just cannot be sure what is
    going to happen when you visit a web site. So we made the Flash
    Player as secure as possible and removed the ability to read or
    write local files.
    AIR, on the other hand, does not have that restriction. So
    you might want to look into that if writing to the local disk is
    important.

  • Another URL/Servlet question...

    Say a user types in:
    http://www.ttonline.org?country=italy/
    In the servlet that services this request, how can I retrieve the string "italy" ?
    Would it be something like
    String value = req.getParamter("country") ?
    And what do you call the stuff on the right hand side of the question mark ? Is that the query string?
    Just in case you want to know why I would have such a URL, is because we want to have different URLs for each country so we can track the number of hits from each country.
    Many thanks,

    In your doGet (or a method performed from the doGet) do the following
         String[]  countries = request.getParameterValues("country");
         // this block of code is to find the form that has been submitted and
         // get the value of the parameter as appropriate.  Each HTML page
         // can only have one instance of a variable name regardless of how
         // many forms it contains.
         if countries != null  && countries .length > 0) {     
              country  = countries [0];     
         }That will get you the parameter value you are looking for.
    good luck!

  • Url Label Question

    I did this to emulate a URL Label
    jLabel3.setForeground(new Color(168, 156, 156));
              jLabel3.setText("Click here to launch in default browser ..");
              jLabel3.addMouseListener(new MouseAdapter() {
                   public void mouseClicked(MouseEvent e)
                        jLabel3_mouseClicked(e);
                   public void mouseEntered(MouseEvent e)
                        jLabel3_mouseEntered(e);
                   public void mouseExited(MouseEvent e)
                        jLabel3_mouseExited(e);
              }); and
    private void jLabel3_mouseClicked(MouseEvent e)
              try {
                   URI uri = new URI("http://lalala/fxrates.xml");
                   Desktop desktop = null;
                   if (Desktop.isDesktopSupported()) {
                        desktop = Desktop.getDesktop();
                   if (desktop != null)
                        desktop.browse(uri);
              } catch (IOException ioe) {
                   ioe.printStackTrace();
              } catch (URISyntaxException use) {
                   use.printStackTrace();
         private void jLabel3_mouseEntered(MouseEvent e)
              jLabel3.setForeground(Color.BLUE);
         private void jLabel3_mouseExited(MouseEvent e)
              jLabel3.setForeground(new Color(168, 156, 156));
         } The question is how do I underline the Labels text ?

    You can search the net for my Visual Font Designer (without the spaces) class, which will allow you to preview the font and generate the code needed to reproduce it elsewhere.
    db

  • ADFLibraryFilter & JpsFilter URL mapping question

    Hi,
    The ADFLibaryFilter and JspFilter are both mapped to the URL /*.
    When accessing static content (e.g. css and image files) the filter hierarchy is build which seems to be unneccessary.
    One of our customers is complaining about this issue, after they have monitored the application using Dynatrace to check server resource usage.
    My question: Is it neccessary to map both filters to the /* or is it okay to map them to the Faces Servlet? Do I need to add other servlets to the mapping (e.h. resources, adfLibResources)?
    ADF version: JDEVADF_11.1.2.1.0_GENERIC_110907.2314.6081
    WebLogic Server: 10.3.5
    Regards,
    Steven.
    Message was edited by: Steven Janssens

    Is it neccessary to map both filters to the /* or is it okay to map them to the Faces Servlet?
    Filters are not mapped to Faces Servlet, but to /*.
    <filter>
       <filter-name>ADFLibraryFilter</filter-name>
       <filter-class>oracle.adf.library.webapp.LibraryFilter</filter-class>
       <init-param>
       <param-name>provider-lazy-inited</param-name>
       <param-value>true</param-value>
       </init-param>
      </filter>
    <filter-mapping>
       <filter-name>ADFLibraryFilter</filter-name>
       <url-pattern>/*</url-pattern>
       <dispatcher>FORWARD</dispatcher>
       <dispatcher>REQUEST</dispatcher>
      </filter-mapping>
    Do I need to add other servlets to the mapping (e.h. resources, adfLibResources)?
    Other servlets may be added.
    <servlet>
       <servlet-name>resources</servlet-name>
       <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
      </servlet>
    <servlet>
       <servlet-name>adflibResources</servlet-name>
       <servlet-class>oracle.adf.library.webapp.ResourceServlet</servlet-class>
      </servlet>
    <servlet-mapping>
       <servlet-name>resources</servlet-name>
       <url-pattern>/adf/*</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
       <servlet-name>resources</servlet-name>
       <url-pattern>/afr/*</url-pattern>
      </servlet-mapping>
    <servlet-mapping>
       <servlet-name>adflibResources</servlet-name>
       <url-pattern>/adflib/*</url-pattern>
      </servlet-mapping>

  • Published URL overwrite question

    I had a published temporary site fail at 60% because (I'm assuming) I had assets that were not sampled correctly. Now that I have fixed that issue, can I publish again to the temp site that I created with my first attempt. (url address at business catalyst? I received the email from Adobe stating the site had been created, but when going to the url is gives me "coming soon"  Thanks

    Yes, you can publish to the same URL. When you publish you will be given that option. (May take a moment to show up)

  • DVD read/writer Question

    I'm so sorry if this has been asked, but here I go anyways. I got my iBook G4 as a gift a bit over a year ago, therefore I didn't really have any control over certain situations. My CD drive does not allow me to burn [write] DVDs. I know this is because it was bought without that feature. Is there anyway to send my iBook to Apple and have them replace my drive with a DVD read/writer? How expensive would this be? Would it just be cheaper to buy and external one from LaCie? Thank you so much for any info!

    No doubt it would be cheaper to add an External like a Lacie or one from any number of manufactures
    You can if you choose have a new CD/DVD Drive and burner installed and there are several different vendors that will do this for you or you can do it your self.
    http://www.mcetech.com/?gclid=CPzAh92mg4YCFQqQJAod-kVOhw
    Here is one, but there are literaly hundreds of places that do this.
    Don

  • URL Simple Question

    I want to put the path of a file into a URL so that I can use the URL to open the file and put it in an image object.
    URL url = New URL("C:\FolderA\FolderB\filename.tif")
    however, I get a Malformed URL Exception
    Any tips?

    Use this
    URL url = new URL("file:\\FolderA\\FolderB\\filename.tif");

  • How to write Question paper program in jsp....

    Hi..,
    This is sure from india. I would like to develop online examination project. Everything is ok. But i have a problem at deveop of question paper. I have 10 questions in my database. I would like display those questions one by one. How can i done this job. Please any one guide me. Because, i am new to this concept.
    with regards
    sure..)-

    First you need to extract all the question from database..
    Then put all of those questions in any of collection object...
    Then set this collection object in request as attribute..
    Keep this object in request till all question are not shown(you can eliminate questions after the have been asked)..
    Code might be like this.
    HashMap result = new HashMap();
    connection = .......;
    Statement stmt=connection.createStatement();
    rs = stmt.executeQuery("Your query");
    int count=0;
    while(rs.next())
    count++;
    String question = rs.getString("colName");
    result.put(""+count,question); //( ""+count)>>>>>means converting int to String
    request.setAttribute("questions",result);
    ====================================================
    now in every JSP which is intended to display a question will have to get this result object..
    Lets assume we are about to display first question()....
    ===========================================
    //////// First get result map from request
    HashMap questions = (HashMap)request.getAttribute("questions");
    String count;
    count = request.getAttribute("count");
    if(count==null)
    count="1";
    String question = questions.get(count);
    count = new String(""+(Integer.parseInt(count).intValue()+1));
    ///Now do what you have to do with this questionresult
    questions.remove();
    request.setAttribute("count",count);////setting question no in request
    request.setAttribute("questions",questions);////setting rest of questions in request
    ===================================================
    hope this might be helpful........
    if there is any problem you can consult me anytime

  • HttpServlet and multiple URL addresses question

    Hi!
    I've created a HttpServlet using the New... wizard (BTW, my web.xml file wasn't updated so I had to do it manually). I've implemented doGet and doPost methods in this class. I specified an url-pattern in web.xml as <url-pattern>/httpservlet/*</url-pattern>.
    If I'd like more than one URL address inside this servlet, what do I need to do? I'd like to have an URL that only supports POST method. This is something I have now as my doGet method looks like this:
        response.setContentType(CONTENT_TYPE);
        PrintWriter out = response.getWriter();
        out.println("<html>");
        out.println("<head><title>HttpServlet</title></head>");
        out.println("<body>");
        out.println("<p>GET method is not supported. Please use POST method for XML messages.</p>");
        out.println("</body></html>");
        out.close();Now I'd like another URL that supports only GET method and has a parameter. This address will be used for downloading some PDF documents. Do I need another HTTP server? Do I have to create a jspx file (how do I 'tell' it that is in this servlet)? Are there other options?
    Thank you in advance for any suggestions.
    BB

    Hi,
    you can create another servlet mapping in web.xml for the same Servlet. However, note that the access path doesn't determine the access method. Your servlet still need to check if it was called from a GET or POST request
    Frank

  • Hard drive read/write question

    Hi,
    I purchased this mac pro(2008) with the stock seagate 320gb hard drive (model ST3320820AS_P) and I am interested to know what kind of read write numbers to expect from this drive.
    I am having a tough time trying to find any numbers that aren't in reference to RAID setups, and became concerned that this drive might be working at peak performance due to firmware issues others are talking about.
    (tangent - I would like to add more drives, but am on the fence for WD or seagate)
    System Info
    Xbench Version 1.3
    System Version 10.5.2 (9C31)
    Physical RAM 2048 MB
    Model MacPro3,1
    Drive Type ST3320820AS_P
    Sequential 92.82
    Uncached Write 70.70 43.41 MB/sec [4K blocks]
    Uncached Write 110.35 62.43 MB/sec [256K blocks]
    Uncached Read 82.04 24.01 MB/sec [4K blocks]
    Uncached Read 129.89 65.28 MB/sec [256K blocks]
    Random 33.16
    Uncached Write 11.33 1.20 MB/sec [4K blocks]
    Uncached Write 73.50 23.53 MB/sec [256K blocks]
    Uncached Read 88.77 0.63 MB/sec [4K blocks]
    Uncached Read 134.04 24.87 MB/sec [256K blocks]

    http://www.barefeats.com/hard94.html
    http://www.barefeats.com/quad07.html
    http://www.barefeats.com/quad08.html
    750GB WD SE16 $168 is hard to beat.
    I saw some systems came with WD 320GB. Guess Apple is using both for now.

  • URL Delivery question

    I am delivering a simple URL to a group of users with no problem, however it launches with the default web browser, explorer. I need it to launch with Firefox, which is available on the local machine. Not having any success. Tried embedding the browsers .exe in quotes at the beginning of the url, ZEN say's can't find web page when I test URL. Any help with best way to accomplish this is greatly appreciated. Dana

    Shaun,
    Thx for the response, worked like a charm. Was even able to add requirements for different delivery location for XP and Win7. Again, Thanks, Dana

Maybe you are looking for

  • Sales BOM in the billing document

    Hi, We have a scenario where a Sales BOM needs to be processed as a third party sale. The requirement is to have the Sales BOM header relevant for generating the PR and PO. However, when the invoice document is created, the components of the sales BO

  • Word wrap in design editor when zoomed

    Hello I use 9.0.1 version of RoboHelp HTML and I'm working on a shared project. I have a Dell Laptop and also have an external monitor that I have configured as an extended desktop. The external monitor is what I use to edit in RoboHelp. The resoluti

  • Sending files with udp

    I want to send the files using udp .I divide files into parts ,write a byte array and send with udp.I can send txt files but when sending other files,doc,pdf,mp3 i have errors. String response = new String(receivePacket.getData()); response=response.

  • Bidders dont have authorization to view Bids

    Hi Experts, We are using SRM 5.0 Extended Classic Scenario. We are getting error message for the bidder as "You have no display authorization"  . They are able to login to the system . The Bidder has got assigned with the proper roles SAP_BBP_STAL_BI

  • Having problems importing graphics

    I am new to FCP X - I am making a corporate. I am using the QT to take screenshots showing a website being used - but when I get it into FCP the screenshots are a bit soft - this is also occuring with graphics I am creating in Photoshop - any suggeat