Results 1 to 3 of 3

Thread: standalone app + webapp

  1. #1
    Join Date
    Oct 2008
    Posts
    2

    Default standalone app + webapp

    I was attracted to Spring based on a description I had read about it. It sounded like one could execute multiple applications within Spring.

    In my case, I need a framework which allows us to run a standalone (main() ) Java application and also a J2EE web application on the same server.

    Specifically, Apache's standalone FTPServer (to receive file uploads), and at the same time, a JSP2.0 Web Application, which is not executed from a main() method, but rather executes in the J2EE App Server (Glassfish)--to receive HTTP requests and respond to them.

    Am I right; can one run both at the same time in Spring? Any problems with this?

    Also, for running standalone Java Applications within Spring (those executed from a call to main() ), how do you start them after they are deployed to the Application Server? In other words... what actually calls main()? I have sifted through dozens of Spring books, but never found an answer to this basic question. FOr standalone Java applications run in Spring, what or who calls main() on the server?

    Remember: I'm not talking about local testing, in my IDE. I know how to execute the main() method in that environment. No--I'm talking about once it is deployed to a remote Application Server. What calls main() to kick off the application in a deployed environment?

  2. #2
    Join Date
    Aug 2004
    Location
    Stockholm
    Posts
    466

    Default

    Spring supports life cycle callbacks on beans. Check this for example:

    http://www.developer.com/open/articl...0930_3504506_3
    You could start your FTP server in the init-method of a FTPLauncherBean

    HTH.
    Sincerely,
    /The Cantor

    "Murphy was an optimist"
    (The O'Toole commentary on Murphy's Law)

  3. #3
    Join Date
    Oct 2008
    Posts
    2

    Default Thanks, Mantorn

    Thank You! I'll give that a try. Appreciated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •