Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7617591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:11:18+00:00 2026-05-31T03:11:18+00:00

Current situation I’m executing an external application (by using Runtime.getRuntime().exec … example here )

  • 0

Current situation

I’m executing an external application (by using Runtime.getRuntime().exec… example here) and I’m listening on the Stream the app writes stdout to.
That part is working as intended and I get results (in grails controller), line by line, as they are available and — when the stream has no more content — I render the result on the page.

Other aspect is initiation of that application from the gsp page, asynchronously. That is also already covered and the remoteFunction call is made (to the above mentioned controller method), the results are gathered and returned and they are correctly displayed in designated area on the page.


But, what is bugging me and what I actually want to achieve is:

Goal

to display the lines read from the stream as they are read, not after the whole stream finishes (as it is done now).

That means (something like, for example) calling render for each line in the Stream-reading loop:

while ((line = bri.readLine()) != null) {
  System.out.println(line);
  //render line here?
}

Can this be achieved?

Please explain 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T03:11:19+00:00Added an answer on May 31, 2026 at 3:11 am

    I think there is no standard grails way to achieve your desired behavoir.

    The g:remoteFunction ist still an tag that wraps the AJAX request for you. The request is bounded to the request response pattern – you can’t get multiple responses for one request.
    Your action code won’t be modified automatically.

    You have to implement it on your own.

    I would try the following:

    • Split your single remoteFunction call into multiple AJAX requests.
    • The first request initializes a new thread which listen to your external application.
    • The results of this application have to be stored in session scope, so that …
    • the following periodical requests from the client can poll the current state of the execution.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Asp.Net/C# in my application.My current situation is that I am using
Here is my current situation: I have a web page containing a couple scrollable
Here is my current situation: I have two tm structs, both set to the
I am developing a web application in asp.net vb. My current situation is, I
Here's my current situation: I have images embedded on a class. package system {
Here's the current situation I'm in: I want to distribute a binary app on
Here is my current situation: I have a user class that has an attribute
Here's a picture of my current situation : alt text http://grab.by/FUM But I don't
Current situation: We do a POST to a certain url using HTTPS/SSL. For this
I have the current situation in my web application: The html files, will request

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.