环境:MyEclipse 14
1 struts1 框架搭建
在MyEclipse新建web project 取名为struts1_login,此时是一个空文档就不截图了然后在project上右键->选择myeclipse->add struts capabilities
单击上面Install Apache Struts(1.x)Facet
点击next
选择*.do ,改下包名改成与你项目相关的。如我的包名为com.lichang.struts1
点击next
点击完成,在我们的WEB-INF下就会多出struts-config.xml文件
以上就是让myeclipse帮我们加入框架的大概过程。项目的整体结构如下:
至此我们的struts1 框架搭建完成2 接着我们就开始编程来实现了。
2 接着我们就开始编程来实现了。
web.xml 如下:
struts1_login index.html index.htm index.jsp default.html default.htm default.jsp action org.apache.struts.action.ActionServlet config /WEB-INF/struts-config.xml debug 3 detail 3 0 action *.do
然后在struts.xml配置LoginAction 代码如下:


