Sample 32245: How to Test a Web Application in SAS® AppDev Studio 3.3
Overview
This sample demonstrates how to test a Web application in SAS AppDev Studio 3.3. During the install and configuration process, a test Tomcat server is created within Eclipse. This server can be used to test Web applications as you develop them.
To test a Web application, you complete these three main tasks, which are discussed in this sample:
Before You Begin
The instructions in this sample assume the following:
- You have completed the new workspace setup steps that were performed after the installation.
- You have created a Web application project that you now want to test.
- You are in the Java EE - Eclipse Platform perspective. If you are not, select Window → Open Perspective → Other.
In the dialog, choose Java EE (default), and then click OK.
Update the catalina.policy file
- In the Project Explorer, expand both the Servers project and the project that you want to test.
-
Right-click on the java.webapp.policy file and select Open with → Text Editor.
- In the java.webapp.policy file, scroll down until you see this line:
// ========== [Your Project Name] Web Application Permissions ==========
|
- Select that comment line down to the end of the file (approximately 100
lines), and then copy the selection to the clipboard.
- Right-click on the catalina.policy file, and select Open with → Text Editor. Scroll to the end of the file and paste the contents that you copied from the java.webapp.policy file in step 4.
- In addition to the properties above, you must copy a few more properties to the default grant block for the catalina.policy file. Locate the following permissions in the java.webapp.policy file and copy what is highlighted in the image below. Do not copy the }; at the end of the block.
-
Back in the catalina.policy file, find the default grant block, as shown below. Paste the lines that you copied in step 6.
- To save the changes to the catalina.policy file, select File → Save.
Update the Tomcat Server Arguments
- Right-click on the launchParameters.txt file, and select Open with → Text Editor.
- Locate the launch parameters, as highlighted below.
- Remove the carriage returns from the parameters, so that they are all on one line. After doing this, copy the line to the clipboard.
- Select Windows → Show View → Servers to open the Servers window.
- Right-click on the server and select Open.
- In the Overview window, click the Open launch configuration link.
- In the Edit launch configuration properties dialog box, select the Arguments tab. In the VM arguments box, scroll to the end of the arguments, type a space (not a carriage return), and then paste the launch parameters that you copied in step 3.
- Click OK.
- Back in the Overview window, scroll to the bottom, and then select the Enable security option.
- Close the Overview window.
Run the Project on the Test Tomcat Server
- Locate the resource you want to test on the server (typically, either a servlet or a JSP page). Right-click on the resource, and select Run as → Run on server to launch the Run On Server wizard.
-
On the Define a New Server page, select the Tomcat server that is already defined. Also, select the Always use this server when running this project option so that this dialog box does not appear in the future.
-
On the Add and Remove Projects page, verify that the project has been selected, and then click Finish.
- After running your project, you can use the Stop and Start icons in the Servers window to control the Tomcat server.
Additional Documentation
For a list of available documentation for SAS AppDev Studio, see http://support.sas.com/documentation/onlinedoc/ads/index.html.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
The sample demononstrates how to publish a Web application to the test Tomcat server, and then execute it
Date Modified: | 2008-06-02 12:41:10 |
Date Created: | 2008-05-28 12:24:22 |
Operating System and Release Information
SAS System | SAS AppDev Studio | Microsoft® Windows® for x64 | 3.3 | | 9.1 TS1M3 SP4 | |
Microsoft Windows 2000 Advanced Server | 3.3 | | 9.1 TS1M3 SP4 | |
Microsoft Windows 2000 Datacenter Server | 3.3 | | 9.1 TS1M3 SP4 | |
Microsoft Windows 2000 Server | 3.3 | | 9.1 TS1M3 SP4 | |
Microsoft Windows 2000 Professional | 3.3 | | 9.1 TS1M3 SP4 | |
Microsoft Windows NT Workstation | 3.3 | | 9.1 TS1M3 SP4 | |
Microsoft Windows Server 2003 Datacenter Edition | 3.3 | | 9.1 TS1M3 SP4 | |
Microsoft Windows Server 2003 Enterprise Edition | 3.3 | | 9.1 TS1M3 SP4 | |
Microsoft Windows Server 2003 Standard Edition | 3.3 | | 9.1 TS1M3 SP4 | |
Microsoft Windows XP Professional | 3.3 | | 9.1 TS1M3 SP4 | |
Windows Vista | 3.3 | | 9.1 TS1M3 SP4 | |