一. 步骤

  1. create new project
    IDEA搭建JSP环境

  2. 填写名字
    IDEA搭建JSP环境

  3. 点击file->project structure,也可以点击工具栏的这个图标
    IDEA搭建JSP环境
    IDEA搭建JSP环境

  4. 自己在web-inf文件里面新建一个名为classes的文件夹和名为lib的文件夹
    IDEA搭建JSP环境

  5. 选中classes文件夹,选择excluded
    IDEA搭建JSP环境

  6. 选择path,修改路径,点击apply,点击OK
    IDEA搭建JSP环境
    选择Dependencies,点击+号,选择jars or …,选择上面创建的lib,弹出框选Jar Directory。
    IDEA搭建JSP环境

  7. 选择Add Configuration
    IDEA搭建JSP环境

  8. 选择tomcat server -> local
    IDEA搭建JSP环境

  9. 点击configuration,选择你本机的tomcat server
    IDEA搭建JSP环境
    IDEA搭建JSP环境

  10. 按照图中的内容设置选项
    IDEA搭建JSP环境

  11. 选择deployment->artifact
    IDEA搭建JSP环境
    IDEA搭建JSP环境

  12. 解决乱码,选择file->settings
    IDEA搭建JSP环境

  13. 右击server,选择run
    IDEA搭建JSP环境

二. 导入tomcat的lib包

  1. 打开project structure
    IDEA搭建JSP环境
  2. 一直点击next或者finish
  3. 在弹出的文件选择框中,找出本机的tomcat里面的lib文件夹,选中它
  4. 最后点击OK

相关文章: