aspose file tools*
The moose likes Struts and the fly likes Struts 2 with eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 with eclipse" Watch "Struts 2 with eclipse" New topic
Author

Struts 2 with eclipse

Udaya Wijenayake
Ranch Hand

Joined: May 15, 2009
Posts: 30
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 ?


SCJP 1.5
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 684


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




Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
Udaya Wijenayake
Ranch Hand

Joined: May 15, 2009
Posts: 30
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

Joined: Sep 07, 2008
Posts: 684

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

Joined: May 15, 2009
Posts: 30
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

Joined: Sep 07, 2008
Posts: 684


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...



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 2 with eclipse
 
Similar Threads
Need help regarding Struts 2
recommended IDE for Struts 2?
How to configure Struts 2 in eclipse
eclipse plugin for struts 2
Integrating GWT with Struts 2