예: System.out 메시지 보기
ActiveX to EJB(Enterprise JavaBeans) 브릿지는 Java™ System.out 메시지를 보는 데 사용 가능한 콘솔이 없습니다. 독립형 클라이언트 프로그램(예: Visual Basic) 실행 시 이 메시지를 보려면, 출력을 파일로 경로 재지정합니다.
이 예제는 출력을 파일로 경로 재지정합니다.
launchClientXJB.bat MyProgram.exe > output.txt
- Active Server Pages와 같은 서비스 프로그램 실행 시 System.out 메시지를 보려면, Java System.out OutputStream 오브젝트를 FileOutputStream으로 대체해야 합니다. 예를 들어, VBScript의 경우 다음과 같습니다.
'Redirect system.out to a file ' Assume that oXJB is an initialized XJB.JClassFactory object Dim clsSystem Dim oOS Dim oPS Dim oArgs ' Get the System class Set clsSystem = oXJB.FindClass("java.lang.System") ' Create a FileOutputStream object ' Create a PrintStream object and assign to it our FileOutputStream Set oArgs = oXJB.GetArgsContainer oArgs.AddObject "java.io.OutputStream", oOS Set oPS = oXJB.NewInstance(oXJB.FindClass("java.io.PrintStream"), oArgs) ' Set our System OutputStream to our file clsSystem.setOut oPS