Introduction of Struts 2
Struts 2 is an Open Source Framework developed by Apache Open Source Community.
It is fully developed in JAVA.
It is a Web Application Framework for developing Java EE web applications.
It is fully developed in JAVA.
It is a Web Application Framework for developing Java EE web applications.
It is a well-organized framework based on MVC architecture.
It is built on the top of Servlet API.
It is built on the top of Servlet API.
It supports both annotation and XML based configurations.
How to Set Environment For Struts 2 ?
Step 1- Download latest version of java SDK, install and configure the setup. At last set PATH Environment variable to refer to the bin folder of your JDK installation directory. e.g-
Here JDK install in JDK6.0 folder of E drive on your computer.
Step 2- Download latest version of Tomcat from http://tomcat.apache.org/ . Once you downloaded, extract the Binary Distribution at any location (whichever location you want). for example in E:\apache-tomcat-7.0.32 . Tomcat can be started by double click on startup.bat . startup.bat is available in
E:\apache-tomcat-7.0.32\bin
Tomcat server can be shutdown by double click on shutdown.bat file. shutdown.bat file is available in
E:\apache-tomcat-7.0.32\bin
Step 3- After successful start of tomcat, you can check by this url http://localhost:8080/ , here 8080 is default port number.The result should be look like this:
now your tomcat server is working fine.Now we will see how to use Eclipse (IDE) to build and run Struts 2 web application.
now your tomcat server is working fine.Now we will see how to use Eclipse (IDE) to build and run Struts 2 web application.
Step 4 - Download latest version of Eclipse(IDE) from http://www.eclipse.org/downloads/ . Once you downloaded, extract zip file to any desire location.For example in E:/eclipse/.
Eclipse can be started by double click on eclipse.exe available in E:/eclipse/ folder.
After successful start of eclipse, it should be look like this:
Step 5- Now set up Struts 2 framework. For this download latest version of struts 2 framework from http://struts.apache.org/download.cgi.
- I downloaded struts-2.3.4.1-all.zip. Unzip this zip file to any location. for example E:/struts-2.3.4.1.
- E:/struts-2.3.4.1/lib folder contains all required jar files for struts 2 framework.
- And E:/struts-2.3.4.1/apps folder contains some sample web application war files including struts2-blank.war file.
- struts2-blank.war file contains all configuration required for running sample Struts 2 web application.
you can run run this sample using Eclipse like this:
- import war file : File ->import->choose struts2-blank.war file (in Eclipse).It should look like this:
After importing struts2-blank.war file, struts2-blank application directory structure look like this:
Now run this struts2-blank application, result on browser should be look like this:
Hope you will be feeling great as you run sample Struts 2 web application. In this sample struts 2 application ,you didn't do any configuration because it already have all the configuration.
In next part, we will learn Struts 2 configuration using Hello world web application.
0 comments:
Post a Comment