zoukankan      html  css  js  c++  java
  • javaweb开发 idea ssm开发(一)

    ### 创建项目 1. 新建一个空白项目 2. 创建父工程 选中Maven 不要勾选任何框架->com.zf.edu common-parent ![](https://img2018.cnblogs.com/blog/1648143/201911/1648143-20191115210729375-1397217561.jpg) 删除src 添加部分代码 ![](https://img2018.cnblogs.com/blog/1648143/201911/1648143-20191115210733195-262636214.jpg) 3. 创建model子工程 ![](https://img2018.cnblogs.com/blog/1648143/201911/1648143-20191115210741085-1034009914.jpg) ![](https://img2018.cnblogs.com/blog/1648143/201911/1648143-20191115210743407-1177121794.jpg) ### 新建一个model 先写字段, 然后按住快捷键生成方法(command+n 选择setting 全选 确定) ![](https://img2018.cnblogs.com/blog/1648143/201911/1648143-20191115210745629-899597972.jpg) 设置数据(command+n 选择toString 全选 确定) 分别创建模块edu-dao edu-service 创建后台模块(edu-manager)选择webapp 创建接口模块(edu-api)选择webapp ### 增加标识 ![](https://img2018.cnblogs.com/blog/1648143/201911/1648143-20191115210753775-495548486.jpg) webapp模型已经默认加了war标识 ### parent抽取公共的依赖 ![](https://img2018.cnblogs.com/blog/1648143/201911/1648143-20191115210756398-1175010020.jpg) ## manager集成springMVC manager ``` UTF-8 1.7 1.7 4.3.14.RELEASE org.springframework spring-aop ${spring.version} org.springframework spring-aspects ${spring.version} org.springframework spring-beans ${spring.version} org.springframework spring-context ${spring.version} org.springframework spring-core ${spring.version} org.springframework spring-expression ${spring.version} org.springframework spring-jdbc ${spring.version} org.springframework spring-orm ${spring.version} org.springframework spring-tx ${spring.version} org.springframework spring-test ${spring.version} org.springframework spring-web ${spring.version} org.springframework spring-webmvc ${spring.version} ``` ## 配置tomcat 选中edu-manager 进行配置 ![](https://img2018.cnblogs.com/blog/1648143/201911/1648143-20191115210759775-643652238.jpg) ![](https://img2018.cnblogs.com/blog/1648143/201911/1648143-20191115210804242-1293121469.jpg) ## 创建一个控制器 web.xml ![](https://img2018.cnblogs.com/blog/1648143/201911/1648143-20191115210810613-520916115.jpg) springmvc.xml ![](https://img2018.cnblogs.com/blog/1648143/201911/1648143-20191115210821949-1502779945.jpg) 控制器文件 ![](https://img2018.cnblogs.com/blog/1648143/201911/1648143-20191115210824351-654073375.jpg) 显示结果 ![](https://img2018.cnblogs.com/blog/1648143/201911/1648143-20191115210825554-1799605998.jpg) > 更多精彩文章请关注 [王明昌博客](https://www.wangmingchang.com)
  • 相关阅读:
    Laravel在不同的环境调用不同的配置文件
    Sphinx全文索引 第一节
    Eclipse 快捷键 (应用中自己总结)
    Ehcache计算Java对象内存大小
    计算Java对象内存大小
    HashMap
    CPU高的排查
    JVM-GC学习
    详细分析Java中断机制-转载
    GC知识记录
  • 原文地址:https://www.cnblogs.com/wmc1125/p/11869571.html
Copyright © 2011-2022 走看看