• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is it possible to create an instance of Servlet and applet from my application's main  RSS feed

 
Hemant Agarwal
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one standalone application. I have one servlet, one applet. Now my question is : Is it possible to create an instance of Servlet and applet from my application's main class?

Some one told me It is not possible. My reasoning is they are also objects so it should be possible.
[ December 19, 2005: Message edited by: Hemant Agarwal ]
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, of course you can.

Now, the question is whether you can actually use them. Many applets work just fine without a browser behind them; those that refer to the browser, though -- calling getCodeBase() or playAudioClip(), for example -- will fail. With a little work, you can get around some of these issues by supplying stub objects.

A servlet is unlikely to be able to do anything without an HttpServletRequest and HttpServletResponse object to work with, so you'd have to supply those, which again, is not insurmountable but requires a little work. You may end up simulating most of a servlet container to get what you need.

Now please have a look at this and this when you have a chance.
 
Hemant Agarwal
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!