|
Adding a virtual web mapping
A virtual web mapping lets you map a physical system path to a logical resource path that might be outside the ColdFusion MX web root. For example, you might want to map the physical directory c:\myapp\resources\images to the logical resource path /images. After setting up the mapping, users access the directory using a URL in the following form:
http://hostname/images/
One advantage to using virtual web mappings is that it hides the physical layout of your application directory structure from users.
To configure a virtual mapping:
| 1 |
In a text editor, open the file web_root\WEB-INF\jrun-web.xml. |
| 2 |
Create a virtual mapping. |
|
For example, the following entry maps the c:\myapp\resources\images directory on a Windows system to the virtual directory /images: |
|
<virtual-mapping>
<resource-path>/images/*</resource-path>
<system-path>c:/myapp/resources/images</system-path>
</virtual-mapping>
|
|
Note: Remember to use forward slash characters in the pathname. |
| 3 |
Save the file. |
| 4 |
Restart the ColdFusion server. |
 |
|
Submit feedback about this tutorial.
|