Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Application in background

  1. #1
    Junior Member
    Join Date
    Oct 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Application in background

    Hi,
    I have created a standard java application that runs infinitely. (and do some logic)

    I would like to setup a web-server that for each user request - will dynamically create a webpage (VIA JSP) that defines the application state in that specific time.


    My question is:
    where do i run\start the application ? i mean, it supposed to run indefinitely on the background.
    i thought maybe make this app as a thread, and when the first user make a HTTP request , a jsp code makes a new thread and start it..

    problem is: when i do that the web-server not responding to new requests. (i guess it waits for the thread to stop?)..

    please help,


    edit:
    i could think of a solution which is very ugly: to run the application separately from the web-server.
    and let them communicate via sockets...
    any other solutions?


    Thanks
    Last edited by urbanleg; December 14th, 2011 at 03:07 PM.


  2. #2
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: Application in background

    See Timer (Java Platform SE 6) and schedule function specially.

  3. #3
    Junior Member
    Join Date
    Oct 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Application in background

    Ok, a thread helped me solve this.

    as well as ajax DWR.
    thanks

Similar Threads

  1. New Background
    By Tjstretch in forum Totally Off Topic
    Replies: 6
    Last Post: November 2nd, 2011, 11:25 PM
  2. Shortcut executed or in-background running Java application
    By xixixao in forum Java Theory & Questions
    Replies: 2
    Last Post: April 22nd, 2011, 04:33 AM
  3. background
    By b109 in forum AWT / Java Swing
    Replies: 0
    Last Post: May 24th, 2010, 06:37 AM
  4. Help with background and objects
    By Afromiffo in forum What's Wrong With My Code?
    Replies: 3
    Last Post: April 8th, 2010, 01:19 AM
  5. Replies: 0
    Last Post: December 3rd, 2009, 03:43 PM