cedric 01/09/10 06:16:30
Added: contrib/tiles/doc/html installation.html
Log:
no message
Revision Changes Path
1.1 jakarta-struts/contrib/tiles/doc/html/installation.html
Index: installation.html
===================================================================
<TABLE>
<TR>
<TD><A name="Prerequisites"></A>
<TABLE border="0" cellspacing="5" cellpadding="5" width="100%">
<TR>
<TD bgcolor="#023264"><FONT color="#ffffff"
face="arial,helvetica,sanserif" size="+1"><STRONG>Prerequisite Software</STRONG></FONT>
</TD>
</TR>
<TR>
<TD>
<BLOCKQUOTE>
<P>Copyright : This page is largely inspired
from the original<A
href="http://www.apache.com/struts/installation.html">Struts
installation page</A>. For those familiar with Struts, there is
nothing realy new.</P>
<P>In order to install and use a binary distribution, you will need to acquire and
install several other software packages, as follows:<BR></P>
<UL>
<LI><STRONG>Java Development
Kit</STRONG>- You must download and install a version 1.1 (or later) Java
Development Kit implementation for your operating system platform.
You<EM>must</EM>have a Java2 version (JDK 1.2 or later) to build the Struts
source distribution, and several of the custom tags in the Struts library
require Java2 to execute. A good starting point for locating Java Development
Kit distributions is<A href="http://java.sun.com/j2se">http://java.sun.com/j2se</A>.
<LI><STRONG>Struts</STRONG>-
You must download and install <A href="http://jakarta.apache.org/struts">Struts</A> ,
with release greater than 0.5.
A compatible release of Struts is attached with examples.
<LI><STRONG>Servlet
Container</STRONG>- You must download and install a servlet container that is
compatible with the Servlet API Specification, version 2.2 or later, and the
JavaServer Pages (JSP) Specification, version 1.1 or later. One popular choice
is to download Apache's<A href="http://jakarta.apache.org/tomcat">Tomcat</A>(version
3.1 or later required,
version 3.2 or later recommended).
<LI><STRONG>Servlet API
Classes</STRONG>- In order to compile Struts itself, or applications that use
Struts, you will need a
<CODE>servlet.jar</CODE>file
containing the Servlet and JSP API classes. Most servlet containers include
this JAR file. Otherwise, you can get the Servlet API classes distribution
from<A href="http://jakarta.apache.org/builds/jakarta-servletapi">here</A>.
<LI><STRONG>XML
Parser</STRONG>- Struts requires the presence of an XML parser that is
compatible with the Java API for XML Parsing (JAXP) specification. You can
download and install the JAXP<A href="http://java.sun.com/xml">reference
implementation</A>, which is required for building the Struts source
distribution. In Struts-based web applications, you may replace the reference
implementation classes with any other JAXP compliant parser, such as<A
href="http://xml.apache.org/xerces-j">Xerces</A>. See detailed instructions
related to the parser in the instructions for<A href="#Building">building</A>and<A
href="#Installing">installing</A>Struts, below.</LI>
</UL></BLOCKQUOTE>
</TD>
</TR>
</TABLE><A name="Building"></A>
<TABLE border="0" cellspacing="5" cellpadding="5" width="100%">
<TR>
<TD bgcolor="#023264"><FONT color="#ffffff"
face="arial,helvetica,sanserif" size="+1"><STRONG>Building Components Library From
Source</STRONG></FONT>
</TD>
</TR>
<TR>
<TD>
<BLOCKQUOTE>
<P>For now, There is no tools facility to
build the Components Library.</P></BLOCKQUOTE>
</TD>
</TR>
</TABLE><A name="Installing"></A>
<TABLE border="0" cellspacing="5" cellpadding="5" width="100%">
<TR>
<TD bgcolor="#023264"><FONT color="#ffffff"
face="arial,helvetica,sanserif" size="+1"><STRONG>Install A Binary
Distribution</STRONG></FONT>
</TD>
</TR>
<TR>
<TD>
<BLOCKQUOTE>
<P>First, download a binary
distribution. Then, make sure you have downloaded and
installed all of the<A href="#Prerequisites">prerequisite</A> software packages
described above.<BR></P>
<P>Unpack the binary distribution into a convenient directory. The distribution
consists of the following contents:<BR></P>
<UL>
<LI><STRONG>lib/components.jar</STRONG>- This JAR file contains all of the
Java classes included in components. It should be copied into the
<CODE>WEB-INF/lib</CODE>directory of
your web application.
<LI><STRONG>lib/components.tld</STRONG>- This is the "tag library descriptor"
file that describes the custom tags in the Components library. It should be
copied into the
<CODE>WEB-INF</CODE>directory of your
web
application.
<LI><STRONG>lib/extension.tld</STRONG>- This is the "extension
tag library descriptor" file that describes the extension tags
which are basically Struts tags, with additional useful
functionalities for components. It should be copied into the
<CODE>WEB-INF</CODE>directory of your
web application.
<LI><STRONG>webapps/comp-struts-portal.war</STRONG>-
This is a "web application archive" file containing all of the
documentation and examples. Start from this example. You can
install this web application on any servlet container compatible with Servlet
API 2.2 or later.
<LI><STRONG>webapps/comp-struts.war</STRONG>- This is
an example web application that uses a large percentage of
Struts features, revisited with Components. You can install this web
application on any servlet container compatible with the Servlet 2.2 (or
later) and JSP 1.1 (or later) specifications.
<LI><STRONG>webapps/comp-struts-instances.war</STRONG>-
This is an example web application that uses a large percentage
of Struts features, revisited with Components and instances. You
can install this web application on any servlet container
compatible with the Servlet 2.2 (or later) and JSP 1.1 (or
later) specifications.</LI>
</UL></BLOCKQUOTE>
<P>To use Components in your own application, you will need to follow these
steps:<BR></P>
<BLOCKQUOTE>
<UL>
<LI>Copy the file
<CODE>lib/components.jar</CODE>from
the Struts distribution into the
<CODE>WEB-INF/lib</CODE>directory of
your web application.
<LI>Copy
<CODE>lib/components.tld and
lib/extensions.</CODE><FONT face="Courier New">tld</FONT>from the
Components distribution into the
<CODE>WEB-INF</CODE>directory
of your web application.
<LI>Modify the
<CODE>WEB-INF/web.xml</CODE>file for
your web application to include a
<CODE><servlet></CODE>element to
define the controller servlet, and a
<CODE><servlet-mapping></CODE>element to establish which request URIs
are mapped to this servlet. Use the
<CODE>WEB-INF/web.xml</CODE>file from
the
Struts example application for a detailed example of the
required syntax.
<LI>If you want to use
<EM>instances</EM>,
use the modified version of <EM>ActionServlet</EM>
, by adding following lines in the
<CODE>WEB-INF/web.xml</CODE>file :
<CODE><BR><servlet><BR>
<servlet-name>action</servlet-name><BR>
<servlet-class>org.apache.struts.tiles.ActionComponentServlet</servlet-class<BR>
<init-param><BR>
<param-name>instances-config</param-name><BR>
<param-value>/WEB-INF/componentInstances.xml</param-value><BR>
</init-param><BR>...<BR> </CODE>
<LI>If you use
<EM>instances</EM> , but don't want to
use modified servlet, you must initialize instances list, either
in your own servlet (see ComponentActionServlet.java) or at
begining of page (see tags).
<LI>Modify the
<CODE>WEB-INF/web.xml</CODE>file of
your web
application to include the following tag library
declarations:<BR>
<taglib><BR>
<taglib-uri>/WEB-INF/components.tld</taglib-uri><BR>
<taglib-location>/WEB-INF/components.tld</taglib-location><BR>
</taglib>
<LI>Create a file
<CODE>WEB-INF/struts-config.xml</CODE>that defines the action mappings for
your specific application. You can use the
<CODE>struts-config.xml</CODE>file
from the portal example application for a detailed example of the required
syntax.
<LI>At the top of each JSP
page that will
use the Component custom tags, add line(s) declaring the
Component custom tag librariesused onthis particular page, like
this:< PRE> <@ taglib uri="/WEB-INF/components.tld"
prefix="comp" %>
<PRE></PRE>
<LI>When compiling the Java
classes that comprise your application, be sure to include the
<CODE>components.jar</CODE>file
(copied earlier)
on the CLASSPATH that is submitted to the compiler.</LI>
</UL></BLOCKQUOTE>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</BODY>
</TD>
</TR>
</TABLE>