Struts2

Setting Up Struts 2 in Eclipse

You can proceed to setup your Struts 2 framework. Following are the simple steps to download and install Struts2 on your machine.

Step 1:

  • Make a choice whether you want to install Struts2 on Windows, or Unix and then proceed to the next step to download .zip file for windows and .tz file for Unix.
  • Download the latest version of Struts2 binaries from http://struts.apache.org/download.cgi.
  • At the time of writing this tutorial, I downloaded struts-2.3.15-all.zip and when you unzip the downloaded file it will give you directory structure inside D:personal dataStruts 2 videostruts-2.3.15 as follows.


Step 2: Second step is to extract the zip file in any location, I downloaded & extracted struts-2.3.15-all.zip in D:personal dataStruts 2 video  folder on my Windows 7 machine so that I have all the jar files into D:personal dataStruts 2 videostruts-2.3.15lib. Make sure you set your CLASSPATH variable properly otherwise you will face problem while running your application.

Step 3:  Now Open your eclipse environment.

Step 4: Click on Files->New->Other

Step 5:  Click on web->Dynamic web project->next

Write your project Name in the text box. I have written “Strut2MyFirstApp
Now here, I am assuming you have apache tomcat 7 server installed in your machine. If you
have target runtime as none then you can refer configure Apache Tomcat in STS IDE.
Now click on Finish button.

Step 6: Now go to location where you have download strut2 package and open lib
folder.you can have all jars but for now you can copy following jars

  • struts2-core-2.3.15
  • xwork-core-2.3.15
  • ognl-3.4
  • commons-io-2.0.1
  • commons-fileupload-1.2.2
  • javassist-3.11.0.GA
  • freemarker-2.3.18
  • commons-lang-2.5
  • commons-logging-1.1.1
  • commons-logging-api-1.1
  • struts2-dojo-plugin-2.3.15.jar

Step 7: Paste all above copied jars to WebRoot->WEB-INF->lib

Step 8: Add all these jars to eclipse build path.
Right click on project(Strut2MyFirstApp)->properties

Step 9: go to project->WebContent->WEB-INF->lib and select all jars then click on ok.

Step 10: Click on ok.
Now you are done with configuring strut2 in eclipse.You can create your struts 2 project.

 

<<Previous <<   || Index ||   >>Next >>
Previous
Next
Dinesh Rajput

Dinesh Rajput is the chief editor of a website Dineshonjava, a technical blog dedicated to the Spring and Java technologies. It has a series of articles related to Java technologies. Dinesh has been a Spring enthusiast since 2008 and is a Pivotal Certified Spring Professional, an author of a book Spring 5 Design Pattern, and a blogger. He has more than 10 years of experience with different aspects of Spring and Java design and development. His core expertise lies in the latest version of Spring Framework, Spring Boot, Spring Security, creating REST APIs, Microservice Architecture, Reactive Pattern, Spring AOP, Design Patterns, Struts, Hibernate, Web Services, Spring Batch, Cassandra, MongoDB, and Web Application Design and Architecture. He is currently working as a technology manager at a leading product and web development company. He worked as a developer and tech lead at the Bennett, Coleman & Co. Ltd and was the first developer in his previous company, Paytm. Dinesh is passionate about the latest Java technologies and loves to write technical blogs related to it. He is a very active member of the Java and Spring community on different forums. When it comes to the Spring Framework and Java, Dinesh tops the list!

Share
Published by
Dinesh Rajput

Recent Posts

Strategy Design Patterns using Lambda

Strategy Design Patterns We can easily create a strategy design pattern using lambda. To implement…

2 years ago

Decorator Pattern using Lambda

Decorator Pattern A decorator pattern allows a user to add new functionality to an existing…

2 years ago

Delegating pattern using lambda

Delegating pattern In software engineering, the delegation pattern is an object-oriented design pattern that allows…

2 years ago

Spring Vs Django- Know The Difference Between The Two

Technology has emerged a lot in the last decade, and now we have artificial intelligence;…

2 years ago

TOP 20 MongoDB INTERVIEW QUESTIONS 2022

Managing a database is becoming increasingly complex now due to the vast amount of data…

2 years ago

Scheduler @Scheduled Annotation Spring Boot

Overview In this article, we will explore Spring Scheduler how we could use it by…

2 years ago