• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
author and iconoclast
Posts: 24204
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks
 
When it is used for evil, then watch out! When it is used for good, then things are much nicer. Like this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic