"Would you tell me, please, which way I ought to go from here?"
"That depends a good deal on where you want to get to."
"I don't much care where"
"Then it doesn't much matter which way you go."
"so long as I get somewhere."
"Oh, you're sure to do that, if only you walk long enough."
The framework's binary distribution needs three other software packages installed to operate. You may already have these installed on your system. To build the framework from source you may need to acquire and install several others. The complete list is as follows:
First, download a binary distribution of Struts by following the instructions here, Then, make sure you have downloaded and installed the prerequisite software packages described above.
Unpack the Library distribution into a convenient directory. (If you are building from the source distribution, the result of the build will already be an unpacked binary distribution for you). The distribution consists of the following contents:
WEB-INF/lib
directory.
struts-core.jar
file into the shared repository
supported by your container. Be advised that this may
cause
ClassNotFoundException problems unless
all
of
your application classes are stored in the shared
repository.
To use Struts Library in your own application, you will need to follow these steps:
lib/*.jar
files from the
Library distribution into the
WEB-INF/lib
directory of your
web application.
WEB-INF/web.xml
file for your web application
to include a
<servlet>
element to define the
controller servlet, and a
<servlet-mapping>
element
to establish which request URIs are mapped to this
servlet. Use the
WEB-INF/web.xml
file from the Struts Mailreader application
for a detailed example of the required syntax.
WEB-INF/struts-config.xml
that defines the
action mappings and other characteristics of your
specific application.
You can use the
struts-config.xml
file from the Struts
Blank application for examples of the required syntax.
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
For most containers, you need only to:
/webapps
directory to your
containers
webapps
directory.
Many application servers execute web applications under the control of a Java security manager, with restricted permissions on what classes in the web application can do. If you utilize form beans with mapped properties, you may encounter security exceptions unless you add the following permission to the set of permissions granted to your application's codebase:
permission java.lang.RuntimePermission "accessDeclaredMembers";
Consult the documentation on your application server for more information about how to configure additional security manager permissions.
Next: FAQs and HowTos