From 72bb904ac58bf2d91cd146050231c5050f97f107 Mon Sep 17 00:00:00 2001 From: Ramkumar K Date: Wed, 7 Aug 2024 16:07:35 +0530 Subject: [PATCH] 6852-draft doc for loose applications-comm-inc-6 6852-draft doc for loose applications-comm-inc-6 #6852 --- modules/ROOT/pages/loose-applications.adoc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/ROOT/pages/loose-applications.adoc b/modules/ROOT/pages/loose-applications.adoc index 43caaaf65..283f6a2c3 100644 --- a/modules/ROOT/pages/loose-applications.adoc +++ b/modules/ROOT/pages/loose-applications.adoc @@ -147,7 +147,7 @@ The following is an example of how you can configure `${example.dir}/application The same concept also holds true for the path of any added file or directory. The physical resource on disk does not need to be in a directory hierarchy that corresponds to the one being declared. -The following is an example of how you can make `${example.dir}/applicationFiles/newfile.txt` appear in the archive as `/only/available/in/application.txt`: +The example demonstrates how to make `${example.dir}/applicationFiles/newfile.txt` appear in the archive as `/only/available/in/application.txt`: [source,xml] ---- @@ -159,7 +159,7 @@ The following is an example of how you can make `${example.dir}/applicationFiles ---- -In each case, the open Liberty server sees the resource by the name and path declared by the `targetInArchive` attribute. The Open Liberty server can navigate the directory hierarchy declared, even if the hierarchy contains only virtual elements, as in the previous example. +In each case, the `targetInArchive` attribute declares the name and path by which the Open Liberty server sees the resource. The Open Liberty server can navigate the directory hierarchy declared, even if the hierarchy contains only virtual elements, as in the previous example. [source,xml] ---- @@ -199,18 +199,18 @@ To use the contents of an application archive as the contents of the virtual arc == Folders and files with the same name -If you have two folders mapped to the same virtual location in the loose application configuration, the folders are merged and the contents of both folders are available. If you have two files with the same target location in the loose archive, the first occurrence of the file is used. The first occurrence is based on a top-down approach to reading the elements of the loose application configuration file. If the first file found is the wrong file to be used, reorder the XML so that the element that contains the version of the file you want is processed first. +If you map two folders to the same virtual location in the loose application configuration, the system merges the folders and makes the contents of both folders available. If you have two files with the same target location in the loose archive, the first occurrence of the file is used. The first occurrence is based on a top-down approach to reading the elements of the loose application configuration file. If the first file found is the wrong file to be used, reorder the XML so that the element that contains the version of the file you want is processed first. The first occurrence applies to files defined in the `dir` elements and files that are defined in the `file` elements. The first occurrence of a file with the same name and virtual location is the one returned from the virtual file system. == Considerations for loose applications -For all loose configured applications, the files are not on disk in the hierarchy that they are declared to be. If your applications access their resources directly and anticipate them to be organized on the disk in the same manner as an expanded `war` or `ear` layout, they could behave unexpectedly. +For all loose configured applications, the files are not on disk in the hierarchy that they are declared to be. If your applications access their resources directly and anticipate them to be organized on the disk in the same manner as an expanded `war` or `ear` layout, they can behave unexpectedly. -You can use `ServletContext.getRealPath` in your applications to discover physical resource paths. `ServletContext.getRealPath` can discover file paths to open to read or write data, and obtain directories. You can use `ServletContext.getRealPath` in your web applications to obtain a path for `/`, you cannot use this path to navigate the application on disk. +You can use `ServletContext.getRealPath` in your applications to discover physical resource paths. `ServletContext.getRealPath` can discover file paths to open to read or write data, and obtain directories. You can use `ServletContext.getRealPath` in your web applications to obtain a path for `/`, but you cannot use this path to navigate the application on disk. -NOTE: When using loose applications, `ServletContext.getRealPath` is unreliable for accessing physical files. Loose applications might merge multiple directories to provide content at one virtual path visible to the application, and `ServletContext.getRealPath` can provide only one of the mapped physical paths. +NOTE: Using loose applications, `ServletContext.getRealPath` is unreliable for accessing physical files. Loose applications can merge multiple directories to provide content at one virtual path visible to the application, and `ServletContext.getRealPath` can provide only one of the mapped physical paths. Consider the following configuration: @@ -232,7 +232,7 @@ These considerations apply only if your applications attempt to directly access == Complex example -The following is a more complex example of loose application configuration. This example uses the elements and creates a complex mapping of files and directories. +A more complex example of loose application configuration uses elements to create a complex mapping of files and directories as shown in the following example. [source,xml] ----