"M.J. Serrino" wrote:
>
> Hi Bruno!
>      I have been looking into the same issue, and I haven't found any
> good,
> concise guidelines regarding this.
> Here are the options I have found, and please feel free to correct me if
> I am
> wrong:
>
> 1.  You can override the service() method with your own method, although
> this is
> not recommended(no reason given).

Because the parent class service() method performs some administration tasks
besides just redirecting to doGet or doPost.

> 2.  If you simply want your servlet to generate html, I believe calling
> the
> servlet like any other general http request for an html page
> (http://my.server.com:port/dir/dir/servletname) will end up in the
> doPost
> method.  Then you can override this method to perform whatever it is
> that you
> are doing, or have the doPost call doGet or some other private method.

I think that it will actually end up in the doGet method. Anything other than
putting the url as the action of a form with a method of post will result in
doGet being called. But the idea is right: access the servlet using a URL and
then in doGet, decide what to do with the request. You can even add extra path
information after the servlet name and deal with that data inside the servlet
(See example 4-9 in Java Servlet Programming, Hunter, et al.)

K Mukhar

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to