Connecting Tech Pros Worldwide Forums | Help | Site Map

init method is called twice !!!

Newbie
 
Join Date: Apr 2007
Posts: 24
#1: Apr 23 '07
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

Member
 
Join Date: Mar 2007
Posts: 122
#2: Apr 23 '07

re: init method is called twice !!!


You need us to see the code please

sandyw
Member
 
Join Date: Apr 2007
Posts: 41
#3: Apr 25 '07

re: init method is called twice !!!


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.
Newbie
 
Join Date: Apr 2007
Posts: 24
#4: Apr 29 '07

re: init method is called twice !!!


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..
Expand|Select|Wrap|Line Numbers
  1. <webuijsf:link binding="#{Page2.link1}" id="link1" url="/resources/stylesheet.css"/>
  2. <webuijsf:link binding="#{Page2.link2}" id="link2" url="/resources/stylesheet.css"/>
  3.  
That line causes this problem... when delete second link, it works normally.

Thanks for help :)
Reply