|
It is not necessarily incorrect to override the service() method. It depends on how you plan on the servlet being invoked. If the servlet will only be invoked as the result of a <FORM METHOD="post" ACTION=.../> or <FORM METHOD="get" ACTION=.../>, etc. tag, then you should not override service() and you should implement doGet and doPost. However, if your servlet will be invoked from a JSP using forward, or if you will invoke the servlet directly from an HTML tag such as <a href ="http://as400service.ibm.com/servlet/EstimatorServlet">Workload Estimator</a>, you will need to implement the service() method. There are two classes, GenericServlet and HttpServlet. HttpServlet extends GenericServlet and adds the doXXX methods which add functionality for invoking the servlet from an HTML page. The Javadoc for both classes can be seen at http://java.sun.com:80/products/servlet/2.3/javadoc/index.html. If you are finding bugs in the samples (quirkiness is a trait most of us have), you should report them to IBM Service or if that is not an option, feel free to send me a note on specific bugs. Please include the minimum steps to recreate the bug and a description of the bug. Thanks, Frances Stewart WebSphere Application Server for iSeries 400 IBM Rochester "Stone, Brad V (TC)" <bvstone@taylorcorp.com>@midrange.com on 02/08/2001 07:14:44 AM Please respond to JAVA400-L@midrange.com Sent by: owner-java400-l@midrange.com To: "'JAVA400-L@midrange.com'" <JAVA400-L@midrange.com> cc: Subject: RE: Servlet question, WAS 3.5.2 You shouldn;t? Hmmm.. I knew these examples I get from IBM are quirky and buggy, but I didn't know they were doing things you shouldn't do... PFffttt... Thanks for your help, Joe. Brad > -----Original Message----- > From: Joe Teff [mailto:JoeTeff@earthlink.net] > Sent: Wednesday, February 07, 2001 10:56 PM > To: JAVA400-L@midrange.com > Subject: RE: Servlet question, WAS 3.5.2 > > > You shouldn't override the service() method. It is the actual > method called by the server and then it in turn calls the > appropriate method for the request (i.e. doGet(), doPost(), > doHead(), DoDelete(), etc.). What I usually do is put my code > in the doGet() and then call it from my doPost() so I have > them both covered. > > public void doGet(HttpServletRequest req, > HttpServletResponse res) { > ... my code ... > } > > public void doPost(HttpServletRequest req, > HttpServletResponse res) { > doGet(req, res); > } > > Joe Teff > > -----Original Message----- > From: owner-java400-l@midrange.com > [mailto:owner-java400-l@midrange.com]On Behalf Of Stone, Brad V (TC) > Sent: Wednesday, February 07, 2001 3:54 PM > To: 'JAVA400-L@midrange.com' > Subject: RE: Servlet question, WAS 3.5.2 > > > Nevermind... dummy me was using doGet instead of service on a POST. > > > -----Original Message----- > > From: tmalin@hannasteel.com [mailto:tmalin@hannasteel.com] > > Sent: Wednesday, February 07, 2001 3:14 PM > > To: JAVA400-L@midrange.com > > Subject: Re: Servlet question, WAS 3.5.2 > > > > > > > > I am assuming you are using the default server. Did you check the > > stderr.log in the logs folder. > > > > > > Tom > > > > > > > > > > +--- > > | This is the JAVA/400 Mailing List! > > | To submit a new message, send your mail to JAVA400-L@midrange.com. > > | To subscribe to this list send email to > JAVA400-L-SUB@midrange.com. > > | To unsubscribe from this list send email to > > JAVA400-L-UNSUB@midrange.com. > > | Questions should be directed to the list owner: joe@zappie.net > > +--- > > > +--- > | This is the JAVA/400 Mailing List! > | To submit a new message, send your mail to JAVA400-L@midrange.com. > | To subscribe to this list send email to JAVA400-L-SUB@midrange.com. > | To unsubscribe from this list send email to > JAVA400-L-UNSUB@midrange.com. > | Questions should be directed to the list owner: joe@zappie.net > +--- > > +--- > | This is the JAVA/400 Mailing List! > | To submit a new message, send your mail to JAVA400-L@midrange.com. > | To subscribe to this list send email to JAVA400-L-SUB@midrange.com. > | To unsubscribe from this list send email to > JAVA400-L-UNSUB@midrange.com. > | Questions should be directed to the list owner: joe@zappie.net > +--- > +--- | This is the JAVA/400 Mailing List! | To submit a new message, send your mail to JAVA400-L@midrange.com. | To subscribe to this list send email to JAVA400-L-SUB@midrange.com. | To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com. | Questions should be directed to the list owner: joe@zappie.net +--- +--- | This is the JAVA/400 Mailing List! | To submit a new message, send your mail to JAVA400-L@midrange.com. | To subscribe to this list send email to JAVA400-L-SUB@midrange.com. | To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com. | Questions should be directed to the list owner: joe@zappie.net +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.