dcsimg
Servlet question for dopost and main()
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   H_Munshi
Posted On:   Tuesday, July 18, 2006 11:36 AM

I have pre-existing servlet code for maintenance purposes.


It received a request by POST action from the client. This class also has main() method where class is instasiated and processed.


Can anyone help me understand reason for having dopost and main() methods.


TIA

Re: Servlet question for dopost and main()

Posted By:   guru_prasanth  
Posted On:   Thursday, July 20, 2006 07:00 AM

servlet can have a dopost method and main method.dopost is called when u invoke the url of the servlet.Servlet is called by webserver.So dopost method can be called only by webserver/appserver.If u have a main method in the servlet u can't call doposT.Even if u call request response may not be valid.

There can be no logical reason for this type for code excpt for some testing(i guess)
About | Sitemap | Contact