RE: Init method of servlet called twice?
Hi, -Original Message- From: Donie Kelly [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 9:42 PM To: 'Tomcat Users List' Subject: Init method of servlet called twice? Hi all Can anybody tell me why the init method can be called twice in a servlet. I am loading the servlet on startup and init is first called there. The first request to the servlet then calls the same init method again? Please help. I cannot init twice. This topic was discussed about a week ago, and Craig gave perfect and clear answer (as always). Try mail archives. As far as I remember init() can be called multiple times if: 1. TC4 and servlet implements SingleThreadModel 2. servlet is called by invoker (something like http://myhost/servlets/myServlet) 3. init() throws exception (that I don't remember exactly) Thanks Donie Anton -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Init method of servlet called twice?
I remember dealing with problems like that before but they are vague in my head. Your problem is better posted on the java forum I think. I am trying to recall what happened. It was something like I would hit back in my browser and then forward so IE would call init again. I remember having many problems with this and netscape and IE behaved differently. Search through some of the archives on the java forum and post there if you can't find it in the archives. Dean -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Init method of servlet called twice?
Craig posted a technical explanation of this about two weeks ago, so search the archives for that, but the short version is that for every unique address that your servlet responds to the init method will be called. Having an alias for your servlet (so you can pass parameters) and using the servlet invoker (i.e. /servlets/com.whatever) is the most common way of having this happen. To solve your problem you need to modify the web.xml file so that your servlet is only referenced once. Randy -Original Message- From: Donie Kelly [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 2:42 PM To: 'Tomcat Users List' Subject: Init method of servlet called twice? Hi all Can anybody tell me why the init method can be called twice in a servlet. I am loading the servlet on startup and init is first called there. The first request to the servlet then calls the same init method again? Please help. I cannot init twice. Thanks Donie -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Init method of servlet called twice?
Thanks Dean but I'm not using IE or Netscape. I'm using a different client which we wrote ourselves. The client hasn't changed but I've done something to cause this behaviour as is didn't do it yesterday Thanks Donie -Original Message- From: Dean Hiller [mailto:[EMAIL PROTECTED]] Sent: February 06, 2002 19:48 To: Tomcat Users List Subject: Re: Init method of servlet called twice? I remember dealing with problems like that before but they are vague in my head. Your problem is better posted on the java forum I think. I am trying to recall what happened. It was something like I would hit back in my browser and then forward so IE would call init again. I remember having many problems with this and netscape and IE behaved differently. Search through some of the archives on the java forum and post there if you can't find it in the archives. Dean -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Init method of servlet called twice?
Yes, Randy, you're right I have two mappings for the same servlet. Can you tell me how to search the archives. Where are they? I only receive this list by mail and have just deleted last weeks list. Thanks for the help Donie -Original Message- From: Randy Layman [mailto:[EMAIL PROTECTED]] Sent: February 06, 2002 19:11 To: 'Tomcat Users List' Subject: RE: Init method of servlet called twice? Craig posted a technical explanation of this about two weeks ago, so search the archives for that, but the short version is that for every unique address that your servlet responds to the init method will be called. Having an alias for your servlet (so you can pass parameters) and using the servlet invoker (i.e. /servlets/com.whatever) is the most common way of having this happen. To solve your problem you need to modify the web.xml file so that your servlet is only referenced once. Randy -Original Message- From: Donie Kelly [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 2:42 PM To: 'Tomcat Users List' Subject: Init method of servlet called twice? Hi all Can anybody tell me why the init method can be called twice in a servlet. I am loading the servlet on startup and init is first called there. The first request to the servlet then calls the same init method again? Please help. I cannot init twice. Thanks Donie -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Init method of servlet called twice?
Do you remember the web page that you signed up to the list from (http://jakarta.apache.org/mail.html)? If you follow the link to the second page, there is a section labeled Archives and Searching that should address all of these questions. Randy -Original Message- From: Donie Kelly [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 3:04 PM To: 'Tomcat Users List' Subject: RE: Init method of servlet called twice? Yes, Randy, you're right I have two mappings for the same servlet. Can you tell me how to search the archives. Where are they? I only receive this list by mail and have just deleted last weeks list. Thanks for the help Donie -Original Message- From: Randy Layman [mailto:[EMAIL PROTECTED]] Sent: February 06, 2002 19:11 To: 'Tomcat Users List' Subject: RE: Init method of servlet called twice? Craig posted a technical explanation of this about two weeks ago, so search the archives for that, but the short version is that for every unique address that your servlet responds to the init method will be called. Having an alias for your servlet (so you can pass parameters) and using the servlet invoker (i.e. /servlets/com.whatever) is the most common way of having this happen. To solve your problem you need to modify the web.xml file so that your servlet is only referenced once. Randy -Original Message- From: Donie Kelly [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 2:42 PM To: 'Tomcat Users List' Subject: Init method of servlet called twice? Hi all Can anybody tell me why the init method can be called twice in a servlet. I am loading the servlet on startup and init is first called there. The first request to the servlet then calls the same init method again? Please help. I cannot init twice. Thanks Donie -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]