![]() |
J2EE applications are built such that they are platform independent and once written, can be run across different types of J2EE-compliant servers. Pramati Studio allows applications to be test-run from inside Studio before deploying and running the application commercially. This chapter describes how to configure and then run applications from within Studio.
Before executing any client, it has to be compiled. Compiling the program lists out all the compilation errors in the build tab of the output panel and can be corrected before running the client. The Run tool available in Studio compiles the client, if not compiled already, and then runs it, by default. This feature can be removed, if desired.
The output of any application when it is run is displayed in the Run tab of the Output Panel in Studio. All output messages of running the application are displayed in the Output Panel. The maximum number of lines shown is 2000. If it exceeds 2000, the first 250 lines are deleted. The messages in the panel cannot be edited. To clear all the messages displayed in the Panel, right click anywhere in the Panel > Clear.
The output messages are stored in a log file, <program_name.log> under the Desk Root directory. Here <program_name.log> is the name of the application program. The Input Text Field appears in the lower half of the Run Tab in the Output Panel. This field is used to enter any inputs to be provided by the user. The text entered in this field is treated as the standard input required by the program.
To run a HTML client:
To run a JSP, compile it and Right Click on the JSP and select Run after deploying the JSP. To access any content, the URL is http://localhost:8181/web-module-name/file where 8181 is the default port name and the file is the file name of the file with the extension. The Web module name is the context root of the web application. For example, to execute gameofeight.jsp, which is packaged into jspDeskWeb.war, the URL entered in the browser should be: http://127.0.0.1:8181/jspDeskWeb/gameofeight.jsp where :8181 is the web Server's default port number and jspDeskWeb in the Web module.
To run a servlet:
Any Java program containing a valid main method can be run from inside Studio. To run any Java client:
If the Java Client looks up for a bean, then
props.put("java.naming.factory.initial", "com.pramati.naming.client.Pramati-
ClientContextFactory");
props.put("java.naming.provider.url", "rmi://127.0.0.1:9191");
props.put(Context.SECURITY_PRINCIPAL,"root");
props.put(Context.SECURITY_CREDENTIALS,"pramati");
props.put("com.pramati.naming.realm","system");
Click on Build > Run File from the main menu or use the keyboard shortcut, Ctrl + Shift + F10 to run the current Java file open in the editor, if it contains a valid main method. The toolbar icon, may also be used for performing this operation.
If the file has only one corresponding desk node, then the file is run using the configuration of that desk node, else a list containing a list of modules pops up, and the user has to choose one to run the file.
To debug a Java program having a main method:
| Pramati Technologies © Copyright |
|