|
Running without Ajax Push
So we now have an application that is ready to run, but without Ajax Push functionality. We'll add that right after we give our counters a test.
For the tutorial applications, we rely on Ant as a build tool and Tomcat 6 as the default container to run the application. To build a .war file successfully, complete the following steps:
3. To compile the source code and generate a .war file with all the required resources, in the console, type:
antBy default, the .war file created is for Tomcat 6. The .war file will be created in the dist directory at the root level of the application.
4. To deploy the.war file to Tomcat 6, copy the easyajaxpush.war file into the Tomcat6 webapps directory.
5. To interact with the application, point your web browser at the following URL, making adjustments for your environment as required. For example, port 8080 is the default port that Tomcat uses, but if you have changed this in your installation, change the URL accordingly.
http://localhost:8080/easyajaxpush/If all goes well, you should see the first incarnation of the Easy Ajax Push Counter application running in your browser.
Clicking the increment and decrement buttons for each counter should change the values. To fully investigate how the counters work, open up another browser window. Some interesting things to look for:
- If you open another window using the same browser (i.e., two Firefox windows) you should notice that the session counter is shared between the two tabs/windows. That's because the session cookie is the same. What you have is two views into the same application from the same session. If you open up another window from a different browser (i.e., one from Firefox and one from IE), the session counters are not shared.
- The counters are only updated in the browser that you interact with. That's because we haven't yet added Ajax Push so the other browser windows don't get the latest values until you interact with them as well.
Copyright 2005-2009. ICEsoft Technologies, Inc. |