• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 with eclipse

 
Udaya Wijenayake
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How could i start a new struts 2 project with eclipse ?
What should be the directory structure ?
Where should i put my java class files and struts.xml file ?

 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

I think you will get all information from below URL ;

http://struts.apache.org/2.x/docs/home.html

AND

http://www.roseindia.net/struts/struts2/index.shtml



 
Udaya Wijenayake
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nishan,

Thanks for your kind help. But in my case i want to know how to create a struts 2 project with eclipse. I know how to create a project manually using tomact server. And i know what should be the directory structure. But i think when we using eclipse its different. So can you guide me to create a struts2 project in eclipse.

Thanks
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

As we know Struts 2 is very easy with compare to Struts 1.X and that is why it is called we can start struts 2 with zero configuration. You have to just create simple web application in eclipse and then configure your project with below instruction .......

Please Make sure you have include six jar for basic Struts 2.0 Application.

1 ) struts2-core-2.1.2
2 ) xwork-2.1.1
3 ) freemarker-2.3.12
4 ) ognl-2.6.11
5 ) commons-collections-3.2
6 ) commons-logging-1.1







And it is in your WEB-INF directory.


Your struts.xml is in the src folder.....

Important things make your struts.xml is in the src floder and start with your application of power of Struts 2.....

Cheers...


 
Udaya Wijenayake
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thank you very much for your help. I got what you said and create a struts 2 project. In default eclipse put java class files in build->classes directory. When i use this default as the class directory it doesn't work. When i change it to WebContent->WEB-INF->classes then it works correctly.

Thanks.
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

First of all understand the deployment environment of any web application in Tomcat always same for all web application.

So, first see that directory structure....... classes always under the WEB-INF directory and lib also in that dir.

So... Now cong. you create Struts 2 application in eclipse...



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic