Take Html Tag's on HTML page

Hello
I have a problem : I want to take the tag attributs in an HTML page so I use the function behind. The problem is that the process don't stop at the end. In the main i take a System.out.println("end"); just before the end and it' printing. There is no infinite loop. So what it is ???
Am I forgety to close somethig or other ???
Thank for your help.
Hello from Paris ;-)
@+ sur la toile
Sckizopublic void chercheComposants()
//Fonction qui recherche les liens dans la page.
javax.swing.text.Element elem;
String uneImage;
String laFrame;
String lelien;
while ((elem = it.next()) != null)
//On cherche les liens
//search links
SimpleAttributeSet a = (SimpleAttributeSet) elem.getAttributes().getAttribute(HTML.Tag.A);
if (a != null)
lelien = (String) a.getAttribute(HTML.Attribute.HREF);
// System.out.println("Lien : "+lelien);
//Si le lien n'est pas d?ja pr?sent dans le vecteur.
//If the links was not in the Vector before I put it in
if (!liens.contains(lelien))
liens.addElement(lelien);
//On cherche les images
//search for picture
if (elem.getName().equals("img"))
AttributeSet attr = elem.getAttributes();
MutableAttributeSet s = new SimpleAttributeSet(attr);
if (s != null)
Object img = s.getAttribute(HTML.Attribute.SRC);
if ((img != null))
// System.out.println("Image : "+img);
uneImage = (String) s.getAttribute(HTML.Attribute.SRC);
//Si l'image n'est pas d?ja pr?sente dans le vecteur.
//if the picture was not in the Vector before I put it in
if (!images.contains(uneImage))
images.addElement(uneImage);

So in french
J'ais le probleme suivant :
Lorsque je lance la fonction chercheComposant, qui trouve les liens sur une page HTML et aussi les images, le processus ne s'arrete pas : comme si j'avais une boucle infinie. J'ais donc v�rifi� en incluant un System.out.println("fini") a la fin de ma fonction Main et il s'affiche !
Je pense donc que je n'ais pas ferm� quelque chose mais je ne sait pas quoi ?
Pourriez vous m'aider s'il vous plait.
translantion by voila.com
I have the following probleme: When I throw(launch) the chercheComposant function, which finds the links on a page HTML and also the images, the process not stop : as if I had an infinite loop. So I verified by including System.out.println ("finity") has the end of my function Main and it displays! I think so that I do not closed anything but I does not know what?
Could use to me please.

Similar Messages

  • Why there is a difference in a "class" attribute value of html tag when viewed in "Page Source" and using "Inspector", I am refering to new Microsoft site?

    While inspecting the new Microsoft site source, I observed that the "class" attribute value of the "html" tag when seen in Page Source the value given by Tools/Web Developer/Inspect tool. Value with the tool indicates class="en-in js no-flexbox canvas no-touch backgroundsize cssanimations csstransforms csstransforms3d csstransitions fontface video audio svg inlinesvg" while that is given in Page Source is class="en-us no-js"
    The question is why different values are shown?

    Inspector is showing you the source after it's been modified by Javascript and such.
    To see the same thing in the source viewer, press '''Ctrl+A''' to select everything on the page, then right-click the selection and choose '''View Selection Source'''.

  • Include lang attribute in html tag of all portal pages

    Hi, anyone knows how is possible to include the lang in the portal pages?
    Now all pages begin with <html> but I need <html lang="es">.
    Where can I update that?
    I mean that is done by some portal service or perhaps with a file.
    all suggestions are welcomed.
    Thanks in advanced.
    Regards.

    The Javascript source URI has the value "RES_NOT_FOUND".
    If I try to access it using ".../faces/javax.faces.resource/javascript.js?ln=js" I get a blank page (contains a Html and Body only).
    If I try to access it using ".../faces/resources/js/javascript.js" I can download the javascript file from the taglib.
    If I manually copy the javascript.js file from the taglib into the enclosing project and save it in "resource/js", then the javascript source URI is resolved correctly to ".../faces/javax.faces.resource/javascript.js?ln=js" and I can downloaded it, but then it is the local copy and not the one from the taglib jar.
    Do I need some specific configuration in web.xml or other deployment descriptors, to be able to use "javax.faces.resource"?
    The only configurations whoch smells like "javax.faces.resource" is this context param: javax.faces.FACELETS_RESOURCE_RESOLVER=oracle.adfinternal.view.faces.facelets.rich.AdfFaceletsResourceResolver
    In web.xml various "resource" servlets is defined (I'm not sure whether I need them, JDeveloper has created them automatically):
    a) resources = org.apache.myfaces.trinidad.webapp.ResourceServlet, maps to: /adf/*, /afr/*, /bi/*
    b) adflibResources = oracle.adf.library.webapp.ResourceServlet, maps to: /adflib/*
    I appreciate your help.

  • Removing index.html from home page / remove .html tags from all other pages

    Hello All,
    I was wondering if there is a way to remove the index.html from my main page, so that www.mypage.com/index.html is simply www.mypage.com/. This also applies to all the other pages in the site, but only for the .html extension: www.mypage.com/contact.html becomes www.mypage.com/contact. Almost all sites I know do this, but I can't figure out the technique beyond working some crazy voodoo with Apache.
    Thanks in advance for your help!

    if 'index.html' is in your HOST server's default filename list, then you can omit its name from any link, e.g.,
    <a href="/">Home</a>
    That link will cause the server to load the default file found in the root folder of the site.
    This is actually the preferred way to link to your home page.

  • HTML tag problem in jsf page

    Hello every body .I am newer in jsf.I have used the following segment in my jsf page .Now I want to read value from intl properties file in place of "*********************".How i will do it?plz help me Thanks in advance.
    <t:panelGrid id="guestUserIstallationhelpnotesGrid" columns="1" width="100%" border="0" columnClasses="next" style="align: right !important;"
                   cellpadding="8">
                        <f:verbatim>
                             <table class="tip" cellspacing="0" width="100%" height="50px" border="0">
                                  <tr>
                                       <td class="tip_headline">
                                       </td>
                                  </tr>
                                  <tr>
                                       <td class="tip_text" ></f:verbatim>
                                            <p align="justify">************
                                            </p>
                                       </td>
                                  </tr>
                             </table>
                        </f:verbatim>
                   </t:panelGrid>

    Use the f:loadBundle component.

  • I moved a html file and now the page doesn't have a background

    I was trying to remove the .html tags from my web pages and followed the advice on this past post. I created a new folder in Dreamweaver's File tab, then moved the .html file over and renamed it to index.html. Unfortunatley the swf and background images are broken and can't reference them. I'm wondering what step I missed, or how can I relink them?
    Original how to remove .html link discussion I referenced.
    http://forums.adobe.com/message/722731#722731
    I wanted to try and use .htaccess with my current GoDaddy account, but I couldn't get that working correctly.
    http://simplemediacode.info/remove-index-html-andor-index-php-from-the-url/
    My website blank page.
    http://www.victorylcms.org/testimonials/
    Thanks for any help!

    You have bad paths to all your external CSS and Scripts. Typically when you move a file into a folder in the Files Panel, DW will ask you if you want to update links.  You should have hit YES.
    To fix the problem, change all of this in your code:
    <link href="style.css" rel="stylesheet" type="text/css" />
    <link href="layout.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="js/cufon-yui.js" type="text/javascript"></script>
    <script src="js/cufon-replace.js" type="text/javascript"></script>
    <script src="js/Schneidler_Md_BT_400.font.js" type="text/javascript"></script>
    <script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
    <!--used for the rotating images that show up if the user doesn't have flash-->
    <script type="text/javascript" src="/assets/js/jquery.cycle.lite.js"></script>
    to this:
    <link href="../style.css" rel="stylesheet" type="text/css" />
    <link href="../layout.css" rel="stylesheet" type="text/css" />
    <script src="../js/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="../js/cufon-yui.js" type="text/javascript"></script>
    <script src="../js/cufon-replace.js" type="text/javascript"></script>
    <script src="../js/Schneidler_Md_BT_400.font.js" type="text/javascript"></script>
    <script src="../Scripts/swfobject_modified.js" type="text/javascript"></script>
    <!--used for the rotating images that show up if the user doesn't have flash-->
    <script type="text/javascript" src="../assets/js/jquery.cycle.lite.js"></script>
    Nancy O.

  • Parse out the contents of meta tag using HTML.Tag

    I need help with using the HTML.Tag class. I don't even know where to start...
    I want to make a method that allows me to pass in a very long string and the NAME of the meta tag.. and will return the contents of the meta tag.. any help will be super..
    sorry i do not have much of a code base to start with.. I am just guessing on how to get this to work..
    private String getMetatag(String content,String Metaname)
    String Metacontents;
    Object HTML.Tag.META;
    Object HTML.Attribute.NAME.Metaname;
         Object HTML.Attribute.CONTENT;
    return Metacontents;
    }

    One of the way to get started is to check out how to overide (extend) the class
    HTMLEditorKit.ParserCallback.. Lets say the class is called class A
    Overide the methods for
    HandleSImpleTags( HTML.Tag t, AttributeSet attribute, int pos) { }
    roughly, the implemenation in that method is like this:
    HandleSImpleTags( HTML.Tag t, AttributeSet attribute, int pos) {
    if(t.equals(HTML.Tag.META) {
    /// your procedure, what to do when encounter META tag
    // String str = (String) attribute.getAttribute(HTML.Attribute.NAME);
    // System.out.println(str);
    You would still need to find some detail examples on how to use class A .
    Roughly it is,
    parser.parse(inputstream, an_instance of_class_A, true); // method in a outer class like a main class
    parser is a instatiation of from the method getParser. This method need to be overidden as well.

  • Define HTML Tag for Parser - Help?

    Hi all,
    I'm trying to write a program which downloads a HTML script, parses it, extracts the links and checks to see which of these links are broken. While the parser is picking up tags that are well-formed, such as:
    Mark Humphrys -
    Research -
    The HTML script has a few malformed HTML tags such as the following:
    <li><b> References </b>
    <li><b> References </b>
    The snippet of code I'm using to try and get these malformed tags is as follows:
         ParserCallback parserCallback = new ParserCallback()
         public void handleText(final char[] data, final int pos) { }
              Tag a = HTML.Tag("a");
              public void handleStartTag(Tag tag, MutableAttributeSet attribute, int pos)
                   if (tag == a)
                   String address = (String) attribute.getAttribute("href");
                        list.add(address);
                   System.out.println(address);
         public void handleEndTag(Tag t, final int pos) {  }
         public void handleSimpleTag(Tag t, MutableAttributeSet a, final int pos) { }
         public void handleComment(final char[] data, final int pos) { }
         public void handleError(final java.lang.String errMsg, final int pos) { }
         };but I keep getting the error that they can't find the Tag() method. At the start of my code I have:
    import javax.swing.text.html.HTML;
    import javax.swing.text.html.HTML.Tag;so I don't understand why the compiler can't find the method. Is there something wrong with the way I'm using it?
    I have very little experience with this area so any help or pointers would be great!

    Sorry, the exact error message is:
    cannot find symbol,
    symbol: constructor Tag(java.lang.String)
    location: class javax.swing.text.html.HTML.Tag
    HTML.Tag a = new HTML.Tag("a");
    ^
    it should of course be a constructor not a method but the compiler still can't seem to find it. The proper code (in as much as I can tell although it still isn't working)
         ParserCallback parserCallback = new ParserCallback()
         public void handleText(final char[] data, final int pos) { }
              HTML.Tag a = new HTML.Tag("a");
              public void handleStartTag(Tag tag, MutableAttributeSet attribute, int pos)
                   if (tag == a)
                   String address = (String) attribute.getAttribute("href");
                        list.add(address);
                   System.out.println(address);
         public void handleEndTag(Tag t, final int pos) {  }
         public void handleSimpleTag(Tag t, MutableAttributeSet a, final int pos) { }
         public void handleComment(final char[] data, final int pos) { }
         public void handleError(final java.lang.String errMsg, final int pos) { }
         };

  • HTML tag HeLp

    Hie ,
    I would like to ask u guys help about a html tag.
    Do HTML tag contains a replacement for the tag "  '" ??????
    as i use this "  "tag for my coding , it brings some error when i re edit the form.
    IF anyone knows plz do let me know here.
    &nbsp is used for space, so i need a different tag that can function same as &nbsp...
    thank you.

    reference this thread with responses
    http://forum.java.sun.com/thread.jspa?messageID=3897479

  • Inserting custom HTML tags into a HTMLDocument to be displayed in a JEditor

    Does anyone know how to insert custom tags into a HTMLDocument to be displayed in a JEditorPane?
    I have tried using the following code,
    kit.insertHTML( doc,
                    jep.getCaretPosition(),
                    "<testtag>FFFF</testtag>",
                    0,
                    0,
                    new HTML.UnknownTag("testtag") );When the above code is run the handleStartTag, handleEndTag and handleText methods are called on the HTMLReader but nothing is inserted into the document model? Can anyone help?
    I have created an instance of HTML.UnknownTag,
      public static HTML.Tag testTag = new HTML.UnknownTag("testtag");I have subclassed HTMLEditorKit and overridden the getParser() method,
      protected Parser getParser(){
        DTD dtd = null;
        try {
          dtd = createDTD( DTD.getDTD("html32"), "html32" );
        } catch ( Exception e ) {
          e.printStackTrace();
        dtd.getElement( "testtag" );
        Parser p = new ParserAdaptor( new DocumentParser( dtd ) );
        return p;
      }I have subclassed HTMLDocument and HTMLDocument.HTMLReader and created a TagAction for my new tag.
    The following code works fine, the custom tag is in the document model,
        String contents =    "<html>"
                           + "<body>"
                           + "<testtag>Here is some text</testtag>"
                           + "</body>"
                           + "</html>";
        ((HTMLDocument)jep.getDocument()).setPreservesUnknownTags(true);
        jep.setText( contents );

    I've been trying to get <blockquote> insert working in an editor but it seems to be a quite difficult task even if it's only about inserting a couple of tags into the right slot! This is the closest I got:
    HTMLDocument doc = (HTMLDocument)editor.getDocument();
    int start = editor.getCaretPosition()
    int paraStart = doc.getParagraphElement(start).getStartOffset();
    int paraEnd = doc.getParagraphElement(start).getEndOffset();
    String insideBlockQuotes = doc.getText(paraStart, paraEnd - paraStart);
    doc.setOuterHTML(doc.getParagraphElement(start),"<blockquote><p>"+insideBlockQuotes+"</p></blockquote>");
    This is how it works: Get the current paragraphs start and end positions, read the text between the start and end into a string, replace the paragrapElement with <blockquote><p>..the text from string..</p></blockquote>.
    This works 'in about' but it's far from perfect.. it has the following problems:
    1. It looses all formatting from the quoted paragraph (bold etc. tags from the quoted part)
    2. It assumes that the paragraphElement was a <p> (could have been another element too!)
    3. It's ugly
    Anybody come up with a better way to use blockquote?

  • HTML tags showing up in the pages also in 2.0?

    Hi,
    After a 5 minutes test of our application after an upgrade to 2.0 I found 3 places where html tags is showing in the bottom of the page. Normally it’s a html tag that is not getting closed. The examples look like this:
    &#60;/
    &#60;INPUT TYPE="hidden" NAME="p_min_row" VALUE
    &#60;script language="JavaScript1.1" type="text/javascript"
    We have been telling the customer that these problems would disappear with the new version, but it have not. I know that we were not the only ones with these problems on 1.6. How are you dealing with this? I can not imagine what our customer is going to say when we tell them that we can’t use htmldb for the project, especially since we were the ones pushing htmldb.
    In release 1.6 the problems were normally only in Internet Explorer and not in Mozilla. I have not been able to check on 2.0, because since the upgrade it is only possible to logon using Internet Explorer. Mozilla gives a script error. :-)

    Hello,
    I have a feeling all your problems are related take a look at this thread. I found it in 10 seconds of searching the forum.
    strange tags
    It's always best to do a quick search first most likely you are not the first person to have this problem.
    Carl

  • Dynamic text box generation in jsp page by using net-ui jsp html tags

    Hi All,
    I Need to generate the "TextBoxes" Dynamically by using the "Net-UI HTML Tags".How can i do this ?
    I am using
    1. WebLogic portal server 8.1 sp4 (Workshop dev environment)
    2. JavaPageFlow Applications
    3. Net-UI tags html jsp
    I need to generate the textboxes dynamically and i have to
    get those values in the page flow .
    How it is possible by using the "Net-UI Tags".
    Thanks In Advance,
    KiranBabu.Karusala

    how we create dynemic text box in jsp based one value which we give at runtime

  • Displaying content in JSP page, want BR but not other Html tags

    I have a page and am reading files and displaying the contents of the files onto the page in a <div> Oneissue is that in the file the end of line are \n or \r\n whichever operation system. I replaced those with <BR> no problem. Now my issue is that I display that in the JSP page:
    <c:out value="${filecontents}" escapeXml="false" />I use escapeXml so that <BR> will add the line breaks. Now my issue is that the file might contains other HTML tags that I want to display simply as text - I don't want the browser to render the other HTML tags.
    Is there a way to do that? Would I have to replace HTML tags with something special?

    Hmm... your file contains HTML tags, but you don't want the browser to interpret them as HTML tags, right? So the way to do that is to use escapeXml="true" in your c:out element.
    But then that also escapes the <BR> tags that you carefully put in there. And you don't want that. You want the browser to interpret those as HTML tags.
    I guess you can't have it both ways. Can you do something like outputting one line of the file at a time with <c:out ... escapeXml="true"> followed by <br>?

  • How to use HTML tags inside JSF pages

    I am creating a Menu using dataTable and outputLink in a JSF page.
    <div class="bodyarea">
    <div id="location">
    <ol>
    <h:dataTable value="#{menuItem.breadCrumb}" var="bread" >
    <h:column>
    <li>
    <h:outputLink id="crumbID" value="#{bread.menuLink}">
    <h:outputText id="crumpName" value="#{bread.menuLabel}" style="width: 165px;"/>
    </h:outputLink>
    <li>
    </h:column>
    </h:dataTable>
    </ol>
    </div>
    </div>
    I want to use <li> HTML tag as shown in code above before and after every <tr> tag formed, but when i run it and see view source, this is how it shows:
    NOTE: you can see it has thrown out of <table> tag itself.
    <div class="bodyarea">
    <div id="location">
    <ol>
    <li>
    </li>
    <table>
    <tbody>
    <tr>
    <td><a id="_id0:0:crumbID" href="/eApps/admin/loginPage.jsp?MenuItem=-1"><span id="_id0:0:crumpName" style="width: 165px;">Home</span></a></td>
    </tr>
    <tr>
    <td><a id="_id0:1:crumbID" href="/eApps/admin/loginPage.jsp?MenuItem=3~-1"><span id="_id0:1:crumpName" style="width: 165px;">HIM Admin</span></a></td>
    </tr>
    </tbody>
    </table>
    </ol>
    </div>
    </div>
    Can some one help me, how do i use HTML tags inside <h:dataTable>.
    Or is their any other way i should form my Menus, to fully utilize to HTML tags.
    Thanks
    Ravi

    Hello,
    You can embed the verbatim elements in your datatable, ie,
    <h:dataTable value="#{menuItem.breadCrumb}" var="bread" >
      <h:column>
        <f:verbatim><li></f:verbatim>
        <h:outputLink id="crumbID" value="#{bread.menuLink}">
          <h:outputText id="crumpName" value="#{bread.menuLabel}" style="width: 165px;"/>
        </h:outputLink>
        <f:verbatim></li></f:verbatim>
      </h:column>
    </h:dataTable>

  • Tag base in HTML page from web repository

    We are using EP 6.0 SP10 with KMC SP10 on host http://ep60:55000/. We want to configure web repository for http://example.com.
    We have created HTTP system "ExampleSite" in KM system landscape for web site "http://example.com", created web site "Example" in KM landscape and configured web repository manager "WebSystems" with prefix "/websys" for created web site "Example" with property "External Server URI Handling"="rewrite".
    We were create URL-iView on link http://ep60:55000/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/websys/Example.
    The problem is following:
    There is no tag <base> in page content when we opening http://example.com directly in browser.
    When we preview created URL-iView page it is opened but tag <base href=http://example.com> is present in HTML page content.
    Thefore all relative links point to http://example.com but not to http://ep60:55000/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/websys/Example as we need.
    What settings (in web repository, HTTP System or anywhere) disables addition tag <base> to page content?

    Hi, All. Sorry for tardy reply.
    Now i'm attempting to use "HTML Filter" (from repository filters in Content Managenment Configurator) for reset base tag.
    Unlike "HTML Stylesheet Filter" working fine (LINK tag is appearing in content of HTML repository documents),
    "HTML Filter" doesn'n work (browser display "500 internal error"). This error possess when we use "HTML Filter" for native CM repository (for example: documents).
    I find following error in knowledgemanagement.0.log file:
    #1.5#C000AC140312000500000002000012240003F737312F4F50#1116241350578#com.sapportals.wcm.protocol.webdav.server.WDGetHandler#irj#com.sapportals.wcm.protocol.webdav.server.WDGetHandler#System#0#####Client_Thread_7##0#0#Error##Plain###Exception while applying filters: null - com.sapportals.wcm.repository.ResourceException: Exception while applying filters: null
    Displaying pages from repository without "HTML Filter" works fine.
    My filter has following properties:
      Base Tag      = http://test.base.tag/
      Extensions    = htm
      MIME Types    = text/html
      Paths         = /**
      Active        = checked
      Priority      = 99
      Repositories  = documents
    I'm not use properties "Base URL", "URL Handler Class"
    What is a reasone of the error?
    Did anybody find a solution to remove/reset base tag?

Maybe you are looking for

  • Hierarchy Query

    Hi All.. I have a hierarchy query with description as below SQL> desc manager_entity; Name                                      Null?    Type MANAGER_ENTITY_ID               NOT NULL NUMBER MANAGER_ENTITY_TYPE_ID      NOT NULL NUMBER MANAGER_ENTITY_P

  • Best way to create Math-Book for several devices

    Hello, I have written some Books about Mathematics and past months I rewrote the first one directly in iBooks Author - My original files have been written in WinWord 15 years ago, so there was only plain text, I could copy/paste into iBooks Author. T

  • Mac Mini doesn't connect to wireless until after logging in

    I'm having an issue with my Mac Mini in that I am unable to connect to it via Screen Sharing in Leopard until after I have logged on to the machine physically (from the login splash screen). I believe it has to do with it not connecting to my wireles

  • Nikon D5300 causes Adobe to freeze

    In LR, or in Bridge Photo Downloader, when I point to my Nikon D5300 to import files, both programs freeze up.  I am using Windows, and from File Explorer I can see the files just fine.  I am also able to import files from other devices to LR without

  • Failure of Airort Express following recent up date

    Have extreme for internet connection and working well. Recently loaded an airport update that in the final screen asked about combining wireless networks. Not fully understanding I selected that option. Since that time my dedicated itunes Apple expre