当前页面: 开发资料首页 → Eclipse 专题 → How to setup a basic Struts project using Eclipse IDE
How to setup a basic Struts project using Eclipse IDE
摘要: How to setup a basic Struts project using Eclipse IDE
This build script assumes Tomcat 5 is the servlet container.
Modify as necessary if a different container is being used.
- Create a new project.
- New Java Project
- Browse for the folder you created for your project.
- Eclipse will detect your source folders from any subdirectories under your project.
- In our case, this is where the src folder was placed.
- Default standard libs are automatically added depending on the type of project.
- Add the existing web app jars.
- Now we need to add a few jars from the file system.
- We always need this one (servlet.jar)
- Ahhhh...everything looks ok for now. You can always go back and modify these settings
- When everything settles down, you should see something like this (of course, it might look different depending on your installation/customization):
- Compilation warnings and errors are detected immediately. In this screenshot, I drill down
into the source folder, package, file, class, and double click on the method....which
brings up the source editor. I hover the mouse over the offending warning to see
a description of what's wrong.
- I changed ApplicationConfig to ModuleConfig, then saved and now I see new errors.
You can right click and import ModuleConfig right from the error.
- A quick look at the import section.
- Right click, Source, Organize Imports
- From the Package Explorer, right click your build.xml and run Ant:
- Is this cool or what?
- Uh Oh!
- Quick look at what jars are being used to process my build.
- I simply removed all the existing jars from the IDE's Ant configuration and
added all from my own installation.
- Can't forget that last one
- Everything went ok (for me)
- Time to test-drive