Content deleted Content added
Jmnbatista (talk | contribs) m link to ASF |
Jmnbatista (talk | contribs) →Example: formatting: indentation of code with definition list |
||
Line 46:
; hello-world.htm
: The default template engine for Click is [[Apache Velocity|Velocity]], the htm file will be similar to a normal, static [[HTML]] page.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Line 54:
</body>
</html>
</source></div>
; HelloWorld.java
: The page model that will be bound to the template.
<div style="margin-left: 2em;"><source lang="java">
package org.wikipedia.click;
Line 72:
}
}
</source></div>
; click.xml
: The heart of a Click application is the <code>click.xml</code> configuration file. This file specifies the application pages, headers, the format object and the applications mode.
: Click is smart enough to figure out that the <code>HelloWorld</code> page class maps to the template <code>hello-world.htm</code>. We only have to inform Click of the package of the <code>HelloWorld</code> class, in this case <code>org.wikipedia.click</code>. We do that through the <code>click.xml</code> configuration file which allows Click to map <code>hello-world.htm</code> requests to the <code>org.wikipedia.click.HelloWorld</code> page class.
: By default the <code>ClickServlet</code> will attempt to load the application configuration file using the path: <code>/WEB-INF/click.xml</code>
<div style="margin-left: 2em;"><source lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<click-app>
<pages package="org.wikipedia.click"/>
</click-app>
</source></div>
; web.xml
: The [[Java servlet|servlet]] application definition.
<div style="margin-left: 2em;"><source lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Line 105 ⟶ 106:
</servlet-mapping>
</web-app>
</source></div>
==Bibliography==
|