Is main() only needed for console application?
Printable View
Is main() only needed for console application?
5o views till now but no reply.
In the amount of time you have waited for an answer on this forum you could have searched the internet and found the answer a thousand times over: servlet main method
I have mentioned this in another thread of yours and will do so again here
And I will post this link one more time:Quote:
You really need to learn how to ask questions the right way, and how to utilize all the resources at your disposal. Virtually all of your posts could be answered with a quick web search and a small amount of time reading.
How To Ask Questions The Smart Way
Seriously, if you want help, post a question that is answerable beyond forcing us to post links to google searches - its a waste of all of our time should you continue to do so.
Q: What happens if I add a main method to my servlet?
A: It is possible to write a main method for a servlet, but it will not be called by the servlet container, it is not part of the servlet lifecycle process. If you invoke your servlet through the main method using the java command it will behave exactly like a standard Java class, it cannot operate as a Web application in its own right and cannot be addressed using HTTP requests. Servlets must run in a servlet container to deliver Web applications as intended.
=> I am conufesd by this answer as pe this main() and by google search I am not getting satisfactory answer.