Download Struts 2.0
In this section we will download and install the Struts 2.0 on the latest
version of Tomcat container. We will first download tomcat and configure it
as our development server. Then we will download Struts 2.0 and install the
struts-blank application on the tomcat server to check the examples that come with the struts-blank application.
Downloading Struts 2.0
Visit the Struts download site http://struts.apache.org/download.cgi
and download the Struts 2.0 for this tutorial.

We have downloaded the Struts 2.0.6 (struts-2.0.6-all.zip) for this tutorial.
Download the Tomcat
Download the latest version of tomcat from http://tomcat.apache.org/download-55.cgi.
We have downloaded apache-tomcat-5.5.20.zip for this tutorial.

I am assuming that latest version of Java is installed
on your system. Extract downloaded file and run the C:\apache-tomcat-5.5.20\bin\startup.bat
to start the tomcat. Type http://localhost:8080/
in your browser, it should show the welcome page in the browser window as shown
below.

Congratulations you have now successfully installed
latest version of tomcat for learning Struts 2.0. Now we will install the
struts-blank application on the tomcat container and test the application.
Extracting Struts 2.0 distribution and installing on
tomcat
Extract the downloaded struts distribution struts-2.0.6-all.zip
into your favorite directory. To install the struts blank application copy
"struts2-blank-2.0.6" from "<extracted directory>\struts-2.0.6-all\struts-2.0.6\apps"
into the webapps directory of tomcat. Tomcat will automatically deploy the
application.
Feb 25, 2007 11:42:23 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Feb 25, 2007 11:42:24 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Feb 25, 2007 11:42:24 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/141 config=null
Feb 25, 2007 11:42:24 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Feb 25, 2007 11:42:24 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 6672 ms
Feb 25, 2007 11:52:55 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive struts2-blank-2.0.6.war |
To test the struts-blank application type http://localhost:8080/struts2-blank-2.0.6
in the browser and the struts-blank application get displayed in your browser
window.

Click the English link and familiarize yourself with
Struts Blank sample application.
Struts 2.0 distribution also contains the following
sample applications that you can try:
- struts2-mailreader-2.0.6.war
- struts2-portlet-2.0.6.war
- struts2-showcase-2.0.6.war
You can simply copy these files to the webapps
directory of your tomcat server. Tomcat will automatically deploy these
applications and then you can test these applications.
|
Current Comments
14 comments so far (post your own) View All Comments Latest 10 Comments:There is an exmaple in rose india site which is wrong code:
obj.fun2(2);
should have two argumnets in fun2(2,3);
URL is:
http://www.roseindia.net/java/learn-java-in-a-day/oops.shtml
Please check the code:
class A{
public void fun1(int x){
System.out.println("int in A");
}
}
class B extends A{
public void fun2(int x,int y){
fun1(6); // prints "int in A"
System.out.println("int in B");
}
}
public class C{
public static void main(String[] args){
B obj= new B();
obj.fun2(2);
}
}
Posted by Varun Singh on Wednesday, 05.7.08 @ 14:06pm | #58788
SEVERE: Context [/struts2-blank-2.0.11] startup failed due to previous errors
Posted by Abhishek Khandelwal on Thursday, 05.1.08 @ 17:44pm | #58308
I found this site providing very useful tips in downloading and understanding Struts.
Posted by Karthic on Friday, 03.21.08 @ 03:05am | #53522
I have problem with starting struts2
When I deploy struts2-blank-2.0.11.war then I get
/log/catalina.out
------------------------------
-
SEVERE: Error filterStart
19.2.2008 2:15:56 org.apache.catalina.core.StandardContext start
SEVERE: Context [/struts2-blank-2.0.11] startup failed due to previous errors
localhost.log
-------------------------------
19.2.2008 2:25:14 org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found
at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
at com.opensymphony.xwork2.util.DomHelper$DOMBuilder.<clinit>(DomHelper.java:167)
at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:115) ........
if I use Tomcat Web Application Manager for start struts2-blank-2.0.11
---------------------------------------------------------------------------------------
FAIL - Application at context path /struts2-blank-2.0.11 could not be started
I use
---------------------
linux fedora7/8
Apache Tomcat/5.5.26
Java 1.6.0_04-b12
Can anybody help me?
Posted by Migi on Tuesday, 02.19.08 @ 07:07am | #48951
In Hello world application i'm gettting the below error while I deploy using Tomcat.
HTTP Status 404 - There is no Action mapped for action name HelloWorld.
Can anybody tell the remedy for this? I need it urgently.
Posted by Rose on Friday, 02.1.08 @ 10:54am | #46815
I am really impressed by the information that i get on this site. Thanks a lot..
Posted by Nirupa on Monday, 01.21.08 @ 12:09pm | #45748
Hi,
I follow your instruction but using ver2.0.11,
I got the following error:
The requested resource (struts2-blank-2.0.11/example/HelloWorld.action) is not available.
Hope that you help me to fix this problem.
Thanks you
Posted by Fox Yong on Wednesday, 12.5.07 @ 16:15pm | #41359
Useful site...
Posted by nisha on Wednesday, 10.24.07 @ 15:51pm | #34676
4. Hi Svitsem!
We got your request to know for downloading the Struts 2.0. Don’t worry Please try again.
Please visit:
Download Struts 2.0.9
Thanks for visiting our site.
Vinod Kumar
Posted by Vinod Kumar on Tuesday, 10.23.07 @ 18:15pm | #34633
Can not download struts 2 from http://struts.apache.org/download.cgi.
Posted by svitsem on Monday, 10.22.07 @ 00:10am | #34521