Getting Started with Struts 2



Struts 2 is an interesting tool for creating web project.

To do struts 2 project in eclipse.

Here we can use eclipse europa version..

File- >new - >other->web- >dynamic web project-> next- >give project name- >next- > next->finish.

Now you can see a folder in the project explorer having the name( here assume demo) that you have given.
the directory structure for our application is given below.

create folder classes inside WEB-INF. Save all packages containing class files inside it.Also save struts.xml file inside this.

copy library files inside :demo\WEB-INF\lib

demo\WEB-INF > web.xml

create jsp files inside demo along with WEB-INF.

To run the project

1. Navigate to "Window -> Show View -> Other..."
2. Open "Server" and select "Servers". This will open a "Servers" tab, probably in your bottom tab panel.
3. Right-click in the new "Servers" tab and select "New -> Server"
4. Select the version of Tomcat you installed and click "Next"
5. Click "Browse" and locate your Tomcat installation, and click "Next"
6. If "demo" isn't already in the "Configured projects" column, move it over and click "Finished"



Now, you should be able to run and debug your project in Tomcat. The way I prefer to do this is to:

1. Right-click on the 'demo' project in the "Package Explorer" and select "Run As -> Run on Server"
2. Select the Tomcat server you set up and click "Finish"


Responses

0 Respones to "Getting Started with Struts 2"

Post a Comment

 

Recent Comments

Popular Posts

Return to top of page Copyright © 2010 | Platinum Theme Converted into Blogger Template by HackTutors