I have a question about the doPost and doGet methods in the HttpServlet class. They are defined as protected in the API so what shall I use when create my servlets? I have seen that some people, books use public and some use protected. Since I actually extend the HttpServlet class when I create my own shouldn't it actually be preferable to use protected?
This is driving me nutz so please explain me the difference (I know the difference about the scopes) but not the difference when implementing it in my servlets.
Nice to be here [ September 07, 2006: Message edited by: Joel Hutters ]
I could explain the difference between the public and protected scopes, but you say you know that already. And you don't want to know the difference when you implement it in your servlets? Then I can't tell what you do want to know. But fortunately it makes no difference at all in practice.
posted 10 years ago
Maybe I'm not that sure about it then, so please explain if possible.
Making it protected means you can't do something like this:But that would be a really strange thing for somebody to do in a web application. Basically you wouldn't ever do it anyway. That's why I say it makes no difference in practice.
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads