Can I use JSP as a controller in MVC Architecture
While no one will come to your office to break your kneecaps if you do, this is generally not considered a good
pattern to follow. Do yourself a favor and become familiar with what is known as the 'Model 2 Pattern' where servlets serve the purpose of controllers, and JSPs are used to render views.
How can I define doPost() or doGet() or service() method in JSP
As Jeffrey pointed out, you don't.
why Servlet is preferred over JSP for the same
There are countless articles all over the web on why the Model 2 pattern is preferred. Do a bit of searching and all will be revealed.
Can I define my own methods in JSP?
Yes, but again, don't. There are now much better mechanisms such as the JSTL and custom actions to add functionality to your JSPs.
Can Global Variable be defined in JSP?
Depends what you mean by 'global'. If you mean class-level members, then yes. But be very very careful. It is very easy to make your JSPs non-thread-safe when doing so. My advice: don't.
In fact, my general advice when it comes to JSPs is: write your JSPs with
no Java in them. None. Zero. Zilch. Nada. With today's level of JSP and Servlet technology, your JSPs should contain markup, JSP actions and directives, JSTL actions and custom actions. Scriplets and scriplet expressions should either be relegated to the past, or used only as a last resort (and since adopting scriptless pages, I have yet to come up against such a 'last resort' scenario).
[ July 22, 2004: Message edited by: Bear Bibeault ]