B4J Question [Solved] JRDC2 send a response

yves67

Active Member
Licensed User
Longtime User
I have added an little Handler to the JRDC server to be able to start a program from the Ipad
It is working but I don't know how to send the response when the program is finished
I cannot put resp As ServletResponse in the shl_ProcessCompleted sub

this is my code :
B4X:
Sub Handle(req As ServletRequest, resp As ServletResponse)
    resp.ContentType = "text/html"
    Dim shl As Shell
    Log ("Command shell F2A_SQL executed")
      shl.Initialize("shl", "C:\ProgramData\JRDC\Start_F2A_SQL.bat", Null)
    shl.Run(-1)
    StartMessageLoop 'need to call this as this is a console app.
End Sub

Sub shl_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
   If Success And ExitCode = 0 Then
     Log("Success")
     Log(StdOut)
    resp.Write("F2A_SQL Ended")   Error ......
   Else
     Log("Error: " & StdErr)
    resp.Write("F2A_SQL Erreur")  Error .......
   End If
End Sub

thanks
Yves67
 
Last edited by a moderator:

yves67

Active Member
Licensed User
Longtime User
oops, I have posted in the wrong forum..... should be B4J questions....
could you transfer ?
 
Upvote 0

yves67

Active Member
Licensed User
Longtime User
ok, thanks for your message
it is working, but I would like to know the result, success and exitcode ?

like at with shl_completed sub

How to do it ?

Thanks again
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…