Date: 2005-02-26T17:31:38
Editor: BernhardEichinger
Wiki: Apache Struts Wiki
Page: StrutsMinimalInstall
URL: http://wiki.apache.org/struts/StrutsMinimalInstall
jars added to work with struts 1.2.4
Change Log:
------------------------------------------------------------------------------
@@ -1,14 +1,16 @@
Struts has a lot of different features, and trying to introduce them all at
once can confuse and scare off users. After getting frustrated reading various
tutorials, I decided to sit down and figure out just how simple a Struts
implementation could be while still preserving a proper MVC (model two)
architecture.
-The Struts HTML and Bean tagsets are wonderful, but they are by no means
required to use Struts: while the tutorials and introductions do not advertise
this fact, Struts works fine with conventional HTML forms and with basic JSPs.
I was able to add Struts support to a simple WebApp using only three *.jar
files and no *.tld files:
+The Struts HTML and Bean tagsets are wonderful, but they are by no means
required to use Struts: while the tutorials and introductions do not advertise
this fact, Struts works fine with conventional HTML forms and with basic JSPs.
I was able to add Struts support to a simple Web``App using only three *.jar
files and no *.tld files:
- 1. struts.jar
- 1. commons-digester.jar
1. commons-beanutils.jar
+ 1. commons-collections.jar
+ 1. commons-digester.jar
+ 1. commons-logging.jar
+ 1. struts.jar
So, simply add those to your WEB-INF/lib/ directory, and you have all the
library support you'll need for now.
-Next, you need to set up WEB-INF/web.xml to use Struts' ActionServlet (ignore
bogus links in the following -- I cannot figure out how to do a proper code
listing in this Wiki):
+Next, you need to set up WEB-INF/web.xml to use Struts' Action``Servlet:
{{{
<web-app>
<display-name>Minimal Struts Application</display-name>
@@ -54,9 +56,8 @@
</body>
</html>
}}}
-The second JSP displays the output from the servlet, and uses a bit of ugly
embedded Java (yes, a tag library would have been cleaner); again, this is
straight-forward, non-Struts stuff:
+The second JSP, hello.jsp, displays the output from the servlet, and uses a
bit of ugly embedded Java (yes, a tag library would have been cleaner); again,
this is straight-forward, non-Struts stuff:
- What should the name of the second jsp page be? It is unclear based on the
code. -Nathaniel Ford
{{{
<html>
<head>
@@ -71,7 +72,7 @@
</body>
</html>
}}}
-Finally, I added two simple classes. The first one, com.megginson.NameBean,
extends the Struts ActionForm class, and is the bean that holds state
information for the request (Struts populates it automatically from the HTML
form):
+Finally, I added two simple classes. The first one, com.megginson.Name``Bean,
extends the Struts Action``Form class, and is the bean that holds state
information for the request (Struts populates it automatically from the HTML
form):
{{{
package com.megginson;
@@ -102,7 +103,7 @@
}
}}}
-The second class, com.megginson.SubmitAction, is virtually useless in its
current state, but is here to show how the architecture works. It extends the
Struts Action class, and is invoked by the Struts ActionServlet:
+The second class, com.megginson.Submit``Action, is virtually useless in its
current state, but is here to show how the architecture works. It extends the
Struts Action class, and is invoked by the Struts Action``Servlet:
{{{
package com.megginson;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]