|
From: Robert W. B. <rb...@di...> - 2001-02-13 02:49:49
|
Hi Brian, On Mon, 12 Feb 2001, Brian Zhou wrote: > If I write: > > def init(self): > # do something > pass > > I got: TypeError: init() too many arguments; expected 1 got 2 This is referring to the line "def init(self):". PyServlet uses 'servlet.init(getServletConfig());', so this is expected. Using the parameterless init() is impossible as is. > > If I write: > > def init(self, config): > javax.servlet.http.HttpServlet.init(self, config) # line 14, want > to do super.init(config) here > # do something > pass > > I got: > line 14, in init > TypeError: init() not enough arguments; expected 2 got 1 This error is referring to "javax.servlet.http.HttpServlet.init(self,config)" not the same "def init" line as above. I thought it might help to point out that the two errors are unrelated. If PyServlet invoked the parameterless init "servlet.init();" on the Jython class, then it seems likely that getInitParameters and getInitParameterNames still work, and the config would be available with getServletConfig. If that works, would people be ok with pre-2.1 servlet being out of luck? -Robert |