init method is called twice !!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • emadattalla1983
    New Member
    • Apr 2007
    • 24

    init method is called twice !!!

    Hi
    I've strange thing...
    I am developing web application using JSP in NetBeans5.5
    and for the child pages, I find the init() method is called twice ?!!
    any idea about the reason behind this ?
    Thanks
  • sandyw
    New Member
    • Mar 2007
    • 122

    #2
    You need us to see the code please

    sandyw

    Comment

    • sateesht
      New Member
      • Apr 2007
      • 41

      #3
      Hi,

      You may be calling the Super class init() method in your subclass init() method, may be this is causing the init() method to be called twice.

      If are able to show your code, we may explain the cause.


      Cheers,
      Sateesh.

      Comment

      • emadattalla1983
        New Member
        • Apr 2007
        • 24

        #4
        Well,
        I finally reached the reason of it...
        in this page, i added 2 links calls css <by mistake while trying something else>...
        then these 2 links calls the init() twice to construct the page according to each one's stylesheet.
        That's why it is called twice..
        Code:
        <webuijsf:link binding="#{Page2.link1}" id="link1" url="/resources/stylesheet.css"/>
        <webuijsf:link binding="#{Page2.link2}" id="link2" url="/resources/stylesheet.css"/>
        That line causes this problem... when delete second link, it works normally.

        Thanks for help :)

        Comment

        Working...