...
在你的java IDE 里面创建一个Web application project命名为Basic_Struts2_Ant,下面是截图
Step 2 - 添加一个index.jsp和Ant文件jsp
添加一个简单的index.jsp页面,他的title是Basic Struts 2 Application - Welcome,他的内容是Welcome to Struts 2!
接着创建一个build.xml文件
然后在eclipse中运行该项目
Step 3 - 添加Struts 2的jar文件到Class Path
我们添加Struts 2最小需求的jar包。我们将把这些jar包拷贝到WEB-INF\lib这个文件夹中。
找到并拷贝这些文件
- asm-x.x.jar
- asm-commons-x.x.jar
- asm-tree-x.x.jar
- commons-fileupload-X.X.X.jar
- commons-io-X.X.X.jar
- commons-lang3-X.X.X.jar
- commons-fileupload-X.X.X.jar
- freemarker-X.X.X.jar
- javassist-X.X.X.jar
- ognl-X.X.X.jar
- struts2-core-X.X.X.X.jar
- xwork-core-X.X.X.jar
You can see from the above that the Struts 2 core jar depends on several other artifacts. As we add additional Struts 2 features in future tutorials, we'll need to add additional Struts 2 jar files and other transitive dependencies.
Create Struts 2 Web Application Using Maven To Manage Artifacts and To Build The Application