### Using JSP with a dedicated machine

JReport Server can be configured so that JSP pages run on a web server machine while the JReport Server Engine is deployed to another machine. In this configuration, the web server machine is viewed as the client machine accessing the JReport Server system.

When this configuration is used, the Java API library used on the client side is different than the one used when JSP pages run in the same JVM as JReport Server. The method calls are the same, but the library for the client provides stubs for the methods that do a Remote Method Invocation (RMI) to the remote JReport Server to have the processing performed over there. All of the classes that are needed are in `<install_root>\lib\JRSRMI.jar`.

The use of RMI as the way to obtain processing is transparent to the JSP code in the client. Developers write exactly the same code in the JSP file. At deploy time, that JSP code will be bound to the proper library to use for the specific configuration.

By using JSPs in your web applications, the Remote Server API enables you to perform report running tasks remotely, to view the report result directly from the client side, and to administer JReport Server, without having to install JReport Server on the client machine.

The Report Server API is provided by the class jet.server.api.rmi. This class can be used explicitly to call methods that are specific to the configuration where RMI is used.

You can find more information about the jet.server.api.rmi package in the JReport Javadoc located in `<install_root>\help\api`.

Before using the Remote Server API, you must make sure that the machines have been configured properly:

1. Open the RMI service by configuration on the JReport Server side.

   Set the two properties server.rmiserver.enable and server.rmiadminservice.enable to true in the server.properties file located in `<install_ root>\bin`.

   When JReport Server resides behind a firewall, you need to specify a fixed port in order to pass through the firewall and obtain the remote objects from the client side by setting the server.rmiserver.fixed_port property in the server.properties file.

2. JReport Server remote host and port information is passed to the client application.

   Set the following parameters as the JVM environment variables in the client side:

   - Djrs.remote.host=<HOST_NAME/IP_address>
   - Djrs.remote.rmiport=<HOST_PORT>
   - Djrs.rmi.auth_file=<authFileName> (optional)

   You have two alternatives for setting these parameters:

   - You can add -Djrs.remote.host, -Djrs.remote.rmiport and -Djrs.rmi.auth_file (optional) to the batch file that is used to start your application.
   - If you are in an integration environment, you can also add the following to the web.xml file:

         <context-param>
             <param-name>jrs.remote.host</param-name>
             <param-value>127.0.0.1</param-value>
         </context-param>
         <context-param>
             <param-name>jrs.remote.rmiport</param-name>
             <param-value>1129</param-value>
         </context-param>
         <!-- The third param(jrs.rmi.auth_file) is optional. "authFileName" includes the auth
         file's realpath and auth file name. For example: C:\JReport\Server\bin\rmi.auth-->
         <context-param>
             <param-name>jrs.rmi.auth_file</param-name>
             <param-value>C:\JReport\Server\bin\rmi.auth</param-value>
         </context-param>
         <listener>
             <listener-class>jet.server.servlets.JRServerContextListener</listener-class>
         </listener>

#### Administering JReport Server remotely

JReport Server can be administered from a remote client by Remote Admin Service API. The administration of a JReport Server includes cluster administration, resource administration, security administration, configuration, connection pool management, resource alias management, connection information provider service, and catalog information management.

You can find the Remote Admin Service API in the jet.server.api.rmi.admin package available in the JReport Javadoc which is located in `<install_root>\help\api`.

Before a JReport Server can be performed the remote administration operation on, you need to set the following properties in the server.properties file located in `<install_ root>\bin` in the JReport Server side:

- server.rmiserver.enable=true
  Used to open the RMI service.
- server.rmiadminservice.enable=true
  Used to open the administration service in the RMI server. By default this property is set to false and the JReport Server does not support remote administration.
- server.rmiserver.fixed_port=<AnOpenedPort>
  Required when JReport Server runs behind a firewall.

#### Using single sign-on in RMI client

When using a Single Sign On (SSO) system, the web application machine is changed. This is where the work is done to set up the Single Sign On system and where to deploy the needed class implementations of the Java interface ExternalAuthorized.

For implementation of SSO in a standalone server, follow the steps below:

1. Write your HttpExternalAuthorized implementation. For details, see Single Sign On in the JReport Server User's Guide.
2. Compile Java classes. Compiling requires the library JRESServlets.jar, which can be found in `<install_root>\lib` directory.
3. Modify the classpath used by your RMI client to include your external authentication classes, so that your application of RMI can access them.

   If it is in an integration environment, you can add the authentication classes in a folder named classes in the WEB-INF folder.

4. Modify the start file of your RMI client to define the system property jrs.httpExternalAuthorized with your implementation.

   For example, assuming that the implementation of this interface is com.mycorp.HttpExternalAuthorizedImpl.class, use the command line to start the RMI client:

   `java -Djrs.httpExternalAuthorized=com.mycorp.HttpExternalAuthorizedImpl ....`

   Then, restart the RMI client.