B4J Code Snippet Start automatically your B4J Server Main Web Page on WebApp Start in Windows

It needs jShell library. You must call the sub immediately after srvr.Start and before StartMessageLoop.

B4X:
Private Sub WindowsStartPage
    Select Case GetSystemProperty("os.name", "").ToLowerCase.Contains("win")
      
        Case True
            Dim sh As Shell
            Dim shresult As ShellSyncResult
            sh.Initialize("sh", "cmd", Array As String("/c", "start", "http://localhost:51042"))
            shresult = sh.RunSynchronous(1500)
            Log(shresult.StdOut)
        Case False
          
    End Select
  
  
End Sub
 

aeric

Expert
Licensed User
Longtime User
I have different code in jrdc3 and jrdc2 server template.
 

hatzisn

Expert
Licensed User
Longtime User
In jRDC3 we are doing the exact same thing. I am going to see now the jRDC2
 

hatzisn

Expert
Licensed User
Longtime User
Top