官网下载lib:
然后选择下载的lib(8个):
再次点击File--->Project Structure,右键选择put into/Web-INF/lib
http://localhost:8080/struts1_war_exploded/
3、日志乱码解决方法(1)打开 tomcat 安装目录下的配置文件 conf/logging.properties ,将所有的GBK改为 UTF-8
(2)Idea :HELP-> Edit Custom VM Options-> 添加 一行 -> 重启IDEA
4、报错问题 4.1 错误1解决方案:需要导入struts2-core.jar中的struts-default.xml。
4.2 错误2两种方法:
1、降web版本,比如5.0 讲到3.1
2、升级tomcat版本
5、实例 5.1 例子1http://localhost:8080/struts1_war_exploded/Action1
5.2 例子2 继承ActionSupport类
struts可以继承ActionSupport类,也可以不继承,继承的好处简单来说就是更方便实现验证,国际化,默认的处理用户请求的方法等功能
参考:https://blog.csdn.net/amazing_banana/article/details/83590485
输入:http://localhost:8080/struts1_war_exploded/login.jsp
6、打包相关 6.1 打包成非war包artifact可以理解为打包,struts1_war_exploded 目录根据自己的需要修改
6.2 打包成war 6.3 war放入tomcat发布放入webapps文件夹下,启动tomcat后自动解压:



