|
1 \chapter{Summary and Future Work} |
|
2 \label{chp:summary} |
|
3 |
|
4 \section{Conclusion} |
|
5 \label{sec:conclusion} |
|
6 To fulfill the user requirements mentioned in section |
|
7 \ref{sec:hardest-isac-requiremnts} Ajax is clearly the way to go. At this time |
|
8 Ajax provides the technical solutions for propagating states from the web server |
|
9 to the web browser. Especially the DWR framework (see \cite{dwr}) provides a lot |
|
10 of ready-to-use components. |
|
11 |
|
12 In my opinion Ajax is also some kind of tricky technology. It is not easy to |
|
13 learn how to work with Ajax from one day to another. There should be some good |
|
14 background knowledge about how Ajax works. In section |
|
15 \ref{sec:preparatory-work} I suggest how to start working with Ajax and how to |
|
16 gain some good background knowledge. I cannot emphasize enough how important it |
|
17 is to understand the basics of Ajax. Otherwise one might end up searching |
|
18 for errors all the time instead of being productive. |
|
19 |
|
20 \section{Directory Structure of \isac s Web Application} |
|
21 \label{sec:dir-structure-web-app} |
|
22 During my work within the \sisac team I proposed the following directory |
|
23 structure for developing the \sisac web application. This directory |
|
24 structure satisfies both, the Servlet specification and the directory structure |
|
25 needed by Eclipse. |
|
26 A typical web application during development consists of different directories |
|
27 which serve their own purpose. In this section I will explain which resources |
|
28 belong into which directory. |
|
29 The basic layout of \sisac's web application looks like this: |
|
30 |
|
31 \begin{verbatim} |
|
32 1 isacweb |
|
33 2 |-src |
|
34 3 |-doc |
|
35 4 |-isac |
|
36 5 | |-css |
|
37 6 | |-images |
|
38 7 | |-js |
|
39 8 | |-WEB-INF |
|
40 9 | | |-lib |
|
41 10 | | |-classes |
|
42 11 | | |-web.xml |
|
43 12 | |-index.jsp |
|
44 13 |-work |
|
45 \end{verbatim} |
|
46 |
|
47 The \texttt{src} directory in line 2 in the above listing |
|
48 contains all sources of the web application. Such sources are Java files, |
|
49 Property files or XML files. When the project gets compiled, all sources are |
|
50 copied to the \texttt{WEB-INF/classes} directory (line 10). Java files get |
|
51 compiled and the their corresponding class files are copied to the |
|
52 \texttt{WEB-INF/classes} directory. All non Java files are copied one-to-one |
|
53 into the \texttt{WEB-INF/classes} directory. |
|
54 |
|
55 The \texttt{doc} directory (line 3) contains useful documentation for both, the |
|
56 end user and developer of the web application. |
|
57 |
|
58 The web application itself starts at the directory \texttt{isac} (line 4). As |
|
59 stated in |
|
60 the Servlet specification (see \cite{jsr154}) a web application consists of a |
|
61 \texttt{WEB-INF} directory (line 8) and inside this directory there are the |
|
62 \texttt{classes} and \texttt{lib} directory (line 9 and 10). As mentioned |
|
63 above, the \texttt{classes} directory is the target directory for compilation. |
|
64 The \texttt{lib} directory contains all 3rd party JARs needed for the web |
|
65 application. |
|
66 |
|
67 As you can guess, cascading stylesheet files go into the \texttt{css} |
|
68 directory (line 5), Javascript files belong into the \texttt{js} directory (line |
|
69 7) and images should be put into the \texttt{images} directory (line 6). |
|
70 |
|
71 The JavaServer Pages itself (JSP files) reside in the root of the web |
|
72 application, which is the \texttt{isac} directory (line 4) in this case. |
|
73 |
|
74 The \texttt{work} directory is a temporary directory for tomcat and contains no |
|
75 resources from developers. Tomcat compiles the JSP files into Servlets and |
|
76 stores them in the work directory. |
|
77 |
|
78 \section{Preparatory work} |
|
79 \label{sec:preparatory-work} |
|
80 Ajax is a very new technology and new frameworks for Ajax pop out from |
|
81 everywhere. During my work with the \sisac team I evaluated some Ajax |
|
82 frameworks. The DWR framework (see \cite{dwr}) is a very powerful framework and |
|
83 very convenient to use. There are a lot of examples which show how to use the |
|
84 different methods of getting data from the server. It is even possible to access |
|
85 Java classes from Javascript code within the web page. Another very powerful |
|
86 feature is that the server can send events to the client, which is not obvious a |
|
87 the first glance of a web application. |
|
88 |
|
89 \subsection{Tomcat and Servlets} |
|
90 \label{subsec:tomcat-servlets} |
|
91 A good point to start is to get familiar with Apache |
|
92 Tomcat\footnote{\url{http://tomcat.apache.org}} and the Servlet technology |
|
93 \footnote{\url{http://java.sun.com/products/servlet/}}. Since \sisac will use |
|
94 Apache Tomcat in version 6, the right specifications to look at are Servlet |
|
95 specification 2.5 and JSP specification 2.1. |
|
96 |
|
97 I suggest to try some examples with Tomcat, to write a Servlet and a JSP file |
|
98 to become familiar with Servlets and JSPs. If you work with Ajax, you do not |
|
99 deal directly with Servlets and JSPs, but when searching for bugs and errors a |
|
100 little background knowledge is recommended. |
|
101 |
|
102 \subsection{Ajax} |
|
103 \label{subsec:ajax} |
|
104 To start with Ajax, I recommend the book Head Rush Ajax \cite{head-rush-ajax}. |
|
105 It starts with the very basics of Ajax and winds up with some advanced |
|
106 concepts, i.g. using JSON \footnote{\url{http://www.json.org/js.html}} to send |
|
107 an receive data. |
|
108 |
|
109 Writing your own code to create a \texttt{XMLHttpRequest} and sending some data |
|
110 to the server, perhaps to a servlet, is also recommended. So you get a feeling |
|
111 of what is going on behind the scene. Jumping directly into the DWR framework |
|
112 with no knowledge about Ajax and Servlets may be very cumbersome, especially |
|
113 when you are looking for errors. |
|
114 |
|
115 \subsection{Firebug} |
|
116 \label{subsec:firebug} |
|
117 Another useful tool for debugging Javascript is Firebug |
|
118 \footnote{\url{https://addons.mozilla.org/de/firefox/addon/1843}}. Firebug is an |
|
119 add-on to the Mozilla Firefox web browser. It shows you if you have errors in |
|
120 your Javascript code on your web page. It is also possible to debug within the |
|
121 Javascript code. I highly recommend using this tool because it makes it very |
|
122 easy to find errors if you are working with Javascript. |