Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can servlet be called from main()

 
Shishir malviya
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we call a Servlet from
public static void main(String arg[])...
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suppose yes, but it will be very complicated, because you should write most of the functionality which provide servlet container for you. Create request/response objects, pass servletconfig, create servletcontext, at the end you will have your own servlet container
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Shishir malviya:
Can we call a Servlet from
public static void main(String arg[])...


Why not using a HTTPConnection ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic