Differences between revisions 5 and 6
Revision 5 as of 2007-01-26 22:16:03
Size: 2388
Editor: 64
Comment:
Revision 6 as of 2007-01-26 22:32:32
Size: 2949
Editor: 64
Comment: Spelling fixes, de-awkwardisation, layout consistency, tomcat case.
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
Locate the document root for your web server. If you do not have a web server, you can download one for free from [http://httpd.apache.org/]. The document root for Apache web servers is indicated in the conf file with the {{{DoccumentRoot}}} variable, and is called htdocs by default. For IIS the document root is under {{{INetPub\wwwroot}}}. Locate the document root for your web server. If you do not have a web server, you can download one for free from [http://httpd.apache.org/]. The document root for Apache web servers is indicated in the {{{conf}}} file with the {{{DocumentRoot}}} variable, and is called {{{htdocs}}} by default. For IIS the document root is under {{{INetPub\wwwroot}}}.
Line 13: Line 13:
For more information consult the documentation of your web server. For more information consult the documentation for your web server.
Line 17: Line 17:
Open up your web browser and navigate to the directory where you unpacked the archive. You can typically access the server on your machine using http://localhost/ as a URL. Locate ajax-index.html (in either dist, samples, or your root directory) and run it your browser. This is a basic XAP application. There should also be html README files in these directories.
Open up your web browser and navigate to the directory where you unpacked the archive. You can typically access the server on your machine using the URL {{{http://localhost/}}}. Locate `ajax-index.html` (in either `dist`, `samples`, or your root directory) and run it your browser. This is a basic XAP application. There should also be html `README` files in these directories.
Line 24: Line 25:
Dynamic user interface powered by Ajax uses images to enable the much of the dynamic nature of the UI; this involves gettinga and setting images rapidly on the fly. IE 6 has a limitation with image cache - it does not check it for images, instead getting the image on the server. This is discussed here and various other places. The workaround is to configure the web server not to add an expires HTTP header. The dynamic user interface powered by Ajax can require the frequent use of images; this involves getting and setting images rapidly on the fly, and works better if any repeatedly used images are locally cached. IE 6 does not handle image caching well - it does not check the cache for previous-loaded images, instead getting the image from the server every time. This is a well-known bug affecting any application using images (see, for example, [http://www.ahinea.com/en/tech/ie-dhtml-image-caching.html here], or [http://www.google.com/search?q=IE%20image%20cache search for the terms "IE image cache"]). The workaround is to configure the web server not to add an "expires" HTTP header.
Line 29: Line 30:
XAL files are cached by the browser. This means that refreshing your application page will not get the latest copy of the XAL file that was edited. This can also be managed by the web server. Another way is to add the header to the page, possible if using server side script technology such as JSP or PHP. In PHP this can be done with: header ( 'cache-control: no-cache' ); XAL files can be cached by any of the popular browsers. By contrast with the case of images under IE 6, his can be ''more'' caching than we'd want, because in this case refreshing your application page will not get the latest copy of a XAL file, even if it's been edited in the meantime. As with image caching, this behavior can be controlled by the web server setup. Another way would be to add an additional header to the page, which is possible if you're using a server side scripting technology such as JSP or PHP. In PHP this can be done by calling: header ( 'cache-control: no-cache' );
Line 34: Line 35:
IIS does not recognize files with a .xal file extension and does not send them by default. This can be worked around by setting a mime type for XAL text/xml; another workaround is to rename the files with a .xml extension. This behavior does not exit on any application servers or on Apache web server. IIS does not recognize files with a .xal file extension and does not send them by default. This can be worked around by setting a mime type for XAL files to be {{{text/xml}}}; another workaround is to rename the files with a the extension {{{.xml}}}. This behavior is not found with the Apache web server or with any application server.

Note: download coming soon...

1. Downloading the XAP zip file

Download the ZIP or TAR versions of the file from the [http://incubator.apache.org/xap XAP Apache site].

2. Unpacking to your web server document directory

Locate the document root for your web server. If you do not have a web server, you can download one for free from [http://httpd.apache.org/]. The document root for Apache web servers is indicated in the conf file with the DocumentRoot variable, and is called htdocs by default. For IIS the document root is under INetPub\wwwroot.

Unpack the contents of the downloaded file into a directory under your server document root.

For more information consult the documentation for your web server.

3. Running the initial example

Open up your web browser and navigate to the directory where you unpacked the archive. You can typically access the server on your machine using the URL http://localhost/. Locate ajax-index.html (in either dist, samples, or your root directory) and run it your browser. This is a basic XAP application. There should also be html README files in these directories.

Important Notes

Image Caching and IE 6

The dynamic user interface powered by Ajax can require the frequent use of images; this involves getting and setting images rapidly on the fly, and works better if any repeatedly used images are locally cached. IE 6 does not handle image caching well - it does not check the cache for previous-loaded images, instead getting the image from the server every time. This is a well-known bug affecting any application using images (see, for example, [http://www.ahinea.com/en/tech/ie-dhtml-image-caching.html here], or [http://www.google.com/search?q=IE%20image%20cache search for the terms "IE image cache"]). The workaround is to configure the web server not to add an "expires" HTTP header.

Cached XAL files

XAL files can be cached by any of the popular browsers. By contrast with the case of images under IE 6, his can be more caching than we'd want, because in this case refreshing your application page will not get the latest copy of a XAL file, even if it's been edited in the meantime. As with image caching, this behavior can be controlled by the web server setup. Another way would be to add an additional header to the page, which is possible if you're using a server side scripting technology such as JSP or PHP. In PHP this can be done by calling: header ( 'cache-control: no-cache' );

Deploying XAL files to IIS

IIS does not recognize files with a .xal file extension and does not send them by default. This can be worked around by setting a mime type for XAL files to be text/xml; another workaround is to rename the files with a the extension .xml. This behavior is not found with the Apache web server or with any application server.

xap/StartHere (last edited 2009-09-20 23:05:42 by localhost)