Announcement Announcement Module
No announcement yet.
How do you start the springframework in an applet? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do you start the springframework in an applet?

    All, I've been looking through the samples and I'm having trouble starting the springframework in an applet when the applet is referenced as another singleton bean in Spring. I wanted to use dependency injection (among other things) on the applet.

    Anyone know how to do this?

    Thank you for your help and feedback!

  • #2
    Technically you don't "start up" Spring as its just a collection of objects that execute in the calling thread. Spring requires an execution environment to actually do anything. In your case it would be the Applet. So basically you can't have Spring create the applet if the applet is where stuff is executed.

    Spring is a container like a bag is a container. It holds stuff. Its not like J2EE "containers" which manage threads, JNDI, EJBs, servlets, JMS, etc.

    However, I can imagine someone could write an AbstractApplet class which looks for and instantiates an ApplicationContext and loads up particular objects used in the implementation of an Applet. Much like an AbstractStatlessSessionBean object is used to be the basis of an EJB, which does something similar.

    As far as I know, there exists no such abstract class. But sounds like it would make a great addition to the Spring RCP project.


    • #3
      AspectJ to the rescue?

      Recently I've been learning AspectJ and find it extremely powerful. It seems that all the Dependency Injection and AOP I could ever imagine can be done with only a few lines of code! Just as a proof of concept, I created a WireFramework aspect that can inject anything I want into any instance just created without changing the parent class. With the power of AspectJ to help you build rich client applications, why bother with trying to get Spring loaded? I can see that a great deal of work is done for you by Spring on the server side, but now I question the utility of spring on the client side.

      I would enjoy reading everyone's thoughts!