Testing artifacts on a server
You can use the server tools to test one or more application artifacts on an application server.
In the Project Explorer view from the J2EE perspective, expand the project that contains the file you want to test.
Right-click the artifact that you want to test. Examples of artifacts include the Web project or a file within the Web project (such as a JSP file, servlet, or HTML file), or an enterprise bean.
Select Run > Run on Server. The Server Selection wizard appears.
Use the radio buttons to specify how you want to select the server. Select from the following options:
Choose an existing server - This option uses an existing server that is defined in your workbench.
Manually define a server - This option creates a new server.
Under the Select the server type list, select a server you want to run your application. The list of available servers, under the Select the server type list, depends on the J2EE specification level you defined for the artifact and the supported servers for this product.
(Optional) Click Next to configure additional settings, such as configuring settings specific to the server:
and adding or removing projects configured on the server:
Click Finish. The server tools automatically complete the following tasks for you:
If the Create server resources in workspace check box on the Server preferences page (Windows > Preferences > Server) is enabled, the server tools creates a server project with Servers as the default name.
Creates the server and adds it to the Servers View.
Adds your project to the server.
Starts the server. (This may take time depending on the server settings.)
If the Automatically publish before starting servers check box on the Server preferences page (Window > Preferences > Server) is selected, the server tools check to see if your project and files on the server are synchronized. If they are not, the project and the files are automatically updated on the remote machine when the server is restarted.
If testing enterprise beans, the server tools display the enterprise bean in the Universal Test Client.
If testing Web artifacts, the server tools adds the EAR project containing your Web project to the server. And display the file in the Web Browser.
Setting publishing preferences for a WebSphere Application Server v6.0
Use the publishing settings to specify whether you want to publish your application on the server or run your application within the development environment without publishing to the server.
The setting Run server with resources on Server runs and publishes your application directly on a remote or local server. The setting Run with resources within the workspace runs your application in the workbench without publishing your application to a server. This mode of running your application is known as running your application on a server test environment.
To configure the publishing settings for WebSphere Application Server v6.x:
In the Servers view, double-click your WebSphere Application Server v6.0 to open the server editor.
Click the Overview tab.
Expand the Publishing section.
Use the radio buttons to select either the following:
Run server with resources within the workspace
Enables you to run your application from within the workbench without publishing to the server. You can enable the Run server with resources within the workspace check box when running a local server. This option is NOT available when running a remote server.
Run server with resource on server
Publishes your application on the targeted server.
In the Enable automatic publishing check box specify whether you want to enable the development environment to publish changes in your application from the workbench to the server.
In the Publishing interval (in minutes) field, specify how long the development environment waits before publishing the changes in your application from the workbench with the server.
Save and close the editor.