SSM整合(XML方式)

这篇具有很好参考价值的文章主要介绍了SSM整合(XML方式)。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

SSM整合之后xml方式

1 系统环境

1.1 软件环境

软件版本:
IDEA 2021.3
Maven 3.6.3
MySql (Mariadb) 10.10
JDK 1.8

1.2 项目环境

1、创建Maven的web工程
SSM整合(XML方式),SSM,ssm
2、引入pom依赖

 <dependencies>
        <!--servlet的依赖-->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>4.0.1</version>
            <scope>provided</scope>
        </dependency>
        
        <!--jsp的依赖-->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.0</version>
        </dependency>

        <!--JSTL表达式-->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>

        <!--SpringWeb-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>5.3.1</version>
        </dependency>

        <!--spring事务-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>5.3.1</version>
        </dependency>

        <!--jsckson的依赖-->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.14.2</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.14.2</version>
        </dependency>

        <!--mybatis的依赖-->
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>3.5.13</version>
        </dependency>
        
        <!--spring整合mybatis-->
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis-spring</artifactId>
            <version>2.1.1</version>
        </dependency>

        <!--mysql依赖-->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.28</version>
        </dependency>
        
        <!--Spring的JDBC-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>5.3.17</version>
        </dependency>

        <!--druid连接池-->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>1.2.16</version>
        </dependency>

        <!--单元测试-->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>

        <!--lombok插件-->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.28</version>
        </dependency>
    </dependencies>

3 设置插件

 <build>
        <resources>
            <resource>
                <!--所在的目录-->
                <directory>src/main/java</directory>
                <!--包括目录下的.properties .xml文件都会扫描到-->
                <includes>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

1.3 配置web.xml

配置前端控制器

    <!--配置前端控制器-->
    <servlet>
        <servlet-name>myssm</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:config/springmvc.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>myssm</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>

注册监听器

    <!--注册监听器-->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:config/applicationContext.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

注册字符过滤器,处理中文乱码

    <!--注册字符过滤器-->
    <filter>
        <filter-name>characterEncodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>utf-8</param-value>
        </init-param>
        <init-param>
            <param-name>forceRequestEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
        <init-param>
            <param-name>forceResponseEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>characterEncodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

1.4 配置jdbc.properties文件

jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/db002
jdbc.username=root
jdbc.password=root

1.5 配置SpringMVC核心文件

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc https://www.springframework.org/schema/mvc/spring-mvc.xsd">
    <!--springMVC的配置文件  配置controller和其他web相关对象-->
    <!--配置扫描-->
    <context:component-scan base-package="com.hx.controller"/>
    <!--配置视图解析器-->
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/jsp/"/>
        <property name="suffix" value=".jsp"/>
    </bean>
    <!--配置注解驱动-->
    <mvc:annotation-driven></mvc:annotation-driven>
</beans>

1.6 配置Spring的核心文件

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:p="http://www.springframework.org/schema/p"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/mvc
        https://www.springframework.org/schema/mvc/spring-mvc.xsd">

        <!--spring的配置文件,声明Service dao等工具类对象-->

    <!-- 加载配置文件 -->
    <context:property-placeholder location="classpath:config/jdbc.properties" />
    <!-- 数据库连接池 -->
    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
          destroy-method="close">
        <property name="driverClassName" value="${jdbc.driver}" />
        <property name="url" value="${jdbc.url}" />
        <property name="username" value="${jdbc.username}" />
        <property name="password" value="${jdbc.password}" />
    </bean>

    <!--声明SqlSessionFactoryBean 创建 sqlSessionFactory-->
    <!-- mapper配置,mybatis的SqlSessionFactoryBean -->
    <!-- 让spring管理sqlsessionfactory 使用mybatis和spring整合包中的 -->
    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <!-- 数据库连接池 -->
        <property name="dataSource" ref="dataSource" />
        <!-- 加载mybatis的全局配置文件 -->
        <property name="configLocation" value="classpath:config/mybatis-config.xml" />
    </bean>

    <!--声明mybatis的扫描,创建dao对象-->
    <!-- 配置Mapper扫描器 -->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
        <property name="basePackage" value="com.hx.dao"/>
    </bean>

    <!--声明service的扫描-->
    <context:component-scan base-package="com.hx.service"/>

</beans>

1.7 配置MyBatis的核心文件

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
    <!--设置实体类别名-->
    <typeAliases>
        <package name="com.hx.domain"/>
    </typeAliases>

    <!--配置接口文件映射-->
    <mappers>
        <!--
            使用package要求:
                1、mapper文件名称和mapper接口名完全一致,包括大小写
                2、mapper文件和mapper接口必须在统一目录
        -->
        <package name="com.hx.dao"/>
    </mappers>
</configuration>

1.8 配置数据库

创建数据库,数据表student
表字段如下:
SSM整合(XML方式),SSM,ssm

1.9 配置文件位置

SSM整合(XML方式),SSM,ssm

2 编写后端代码

2.1 编写实体类

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Student {
    private Integer sid;
    private String sname;
    private Integer sage;
}

2.2 编写Dao接口

@Mapper
public interface StudentDao {
    //查询所有
    List<Student> findAll();
    //新增数据
    int addStu(@Param("student") Student student);
    //删除数据
    int delStuById(Integer sid);
    //修改数据
    int updateStu(Student student);
}

2.3 编写Dao映射文件(resource目录下)

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hx.dao.StudentDao">
    <!--查询所有列表-->
    <select id="findAll" resultType="Student">
        select sid, sname, sage
        from student;
    </select>
    <!--新增数据-->
    <insert id="addStu">
        insert into student
        values (#{student.sid}, #{student.sname}, #{student.sage});
    </insert>
    <!--删除数据-->
    <delete id="delStuById">
        delete
        from student
        where sid = #{sid}
    </delete>
    <!--修改数据-->
    <update id="updateStu" parameterType="Student">
        update student
        set sname=#{sname},
            sage=#{sage}
        where sid = #{sid}
    </update>
</mapper>

2.4 编写Service接口

public interface StudentService {
    //查询所有
    List<Student> selectAll();

    //插入数据
    int insertStu(Student student);

    int delStuById(Integer sid);

    int updateStu(Student student);
}

2.5 编写ServiceImpl实现类

@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentDao studentDao;

    @Override
    public List<Student> selectAll() {
        return studentDao.findAll();
    }

    @Override
    public int insertStu(Student student) {
        return studentDao.addStu(student);
    }

    @Override
    public int delStuById(Integer sid) {
        return studentDao.delStuById(sid);
    }

    @Override
    public int updateStu(Student student) {
        return studentDao.updateStu(student);
    }
}

2.6 编写Controller类

1、业务Controller

@Controller
@RequestMapping("/student")
public class StudentController {

    @Autowired
    private StudentService studentService;

    @GetMapping("/getAll.do")
    public ModelAndView getAll() {
        List<Student> list = studentService.selectAll();
        ModelAndView mv = new ModelAndView();
        mv.addObject("list", list);
        mv.setViewName("listStu");
        return mv;
    }

    @PostMapping("/add.do")
    public ModelAndView saveStu(Student student) {
        String tips = "插入失败";
        ModelAndView mv = new ModelAndView();
        int i = studentService.insertStu(student);
        if (i > 0) {
            tips = "插入成功";
        }
        mv.addObject("data1", tips);
        mv.setViewName("success");
        return mv;
    }

    @RequestMapping("/put.do")
    public ModelAndView putStu(Student student) {
        String tips = "修改失败!";
        ModelAndView mv = new ModelAndView();
        int i = studentService.updateStu(student);
        if (i > 0) {
            tips = "修改成功";
        }
        mv.addObject("data2", tips);
        mv.setViewName("success");
        return mv;
    }

    @RequestMapping(value = "/del.do")
    public ModelAndView delStu(Integer sid) {
        String tips = "删除失败!";
        ModelAndView mv = new ModelAndView();
        int i = studentService.delStuById(sid);
        if (i > 0) {
            tips = "删除成功";
        }
        mv.addObject("data3", tips);
        mv.setViewName("success");
        return mv;
    }
}

2、页面相关Controller

@RestController
@RequestMapping("/index")
public class IndexController {

    @RequestMapping("/m1Add.do")
    public ModelAndView m1Add(){
        ModelAndView mv = new ModelAndView();
        mv.setViewName("add");
        return mv;
    }
    @RequestMapping("/m2Put.do")
    public ModelAndView m2Put(){
        ModelAndView mv = new ModelAndView();
        mv.setViewName("put");
        return mv;
    }
    @RequestMapping("/m3Del.do")
    public ModelAndView m3Del(){
        ModelAndView mv = new ModelAndView();
        mv.setViewName("del");
        return mv;
    }
}

2.7 代码映射文件位置

SSM整合(XML方式),SSM,ssm

3 编写前端代码

3.1 编写首页index.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <style>
        div {
            background-color: antiquewhite;
            width: 400px;
            height: 200px;
            margin: 100px auto;
            text-align: center;
            background-image: url("images/p5.jpg");
            background-repeat: no-repeat;
        }

        a {
            text-decoration: none;
            color: orange;
        }

        button {
            margin: 10px 20px;
        }
    </style>
</head>
<body>
<div>
    <h1>功能区首页</h1><br>
    <button><a href="/student/getAll.do">查询数据</a></button>

    <button><a href="/index/m1Add.do">插入数据</a></button>
    <br>
    <button><a href="/index/m2Put.do">修改数据</a></button>

    <button><a href="/index/m3Del.do">删除数据</a></button>
</div>
</body>
</html>

3.2 配置Tomcat

SSM整合(XML方式),SSM,ssmSSM整合(XML方式),SSM,ssm

3.3 webapp下配置图片

SSM整合(XML方式),SSM,ssm

3.4 编写功能页面WEB-INF下

SSM整合(XML方式),SSM,ssm

1 编写 listStu.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
   String basePath =
           request.getScheme() + "://" +
                   request.getServerName() + ":" +
                   request.getServerPort() + request.getContextPath() + "/";
%>
<html>
<head>
   <title>展示所有学生信息</title>
   <style>
       .box1 {
           width: 300px;
           height: 400px;
           text-align: center;
           margin: 10px auto;
           background-image: url("/images/p3.jpg");
           background-repeat: no-repeat;
       }
       .box2 {
           width: 80px;
           height: 25px;
           text-align: center;
           margin: 10px auto;
       }
   </style>
</head>
<body>
<div class="box1">
   <table border="1px" width="300px" height="30px" align="center" cellspacing="0" cellpadding="0">
       <caption style="font-size: 20px">学生信息表</caption>
       <tr bgcolor="#a9a9a9" text-align="center">
           <td>学号</td>
           <td>姓名</td>
           <td>年龄</td>
       </tr>
       <%--数据行--%>
       <c:forEach items="${list}" var="stu" varStatus="s">
           <tr>
               <td>${stu.sid}</td>
               <td>${stu.sname}</td>
               <td>${stu.sage}</td>
           </tr>
       </c:forEach>
   </table>
   <%--返回到首页--%>
   <div class="box2">
       <form action="<%=basePath%>index.jsp">
           <input type="submit" name="返回" value="返回功能区">
       </form>
   </div>
</div>
</body>
</html>

2 编写 add.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String basePath =
            request.getScheme() + "://" +
                    request.getServerName() + ":" +
                    request.getServerPort() + request.getContextPath() + "/";
%>
<html>
<head>
    <title>新增学生信息</title>
    <style>
        div {
            background-color: antiquewhite;
            width: 300px;
            height: 180px;
            margin: 100px auto;
            text-align: center;
            line-height: normal;
            background-image: url("/images/p1.jpg");
            background-repeat: no-repeat;
        }
        .box2 {
            width: 80px;
            height: 25px;
            text-align: center;
            margin: auto;
        }
    </style>
</head>
<body>
<div>
    <h3>新增数据</h3>
    <form action="/student/add.do" method="post">
        学号:<input type="text" name="sid" value=""><br>
        姓名:<input type="text" name="sname" value=""><br>
        年龄:<input type="text" name="sage" value=""><br>
        <input type="submit" value="添加">
        <input type="reset" value="重置">
    </form>
    <%--返回到首页--%>
    <div class="box2">
        <form action="<%=basePath%>index.jsp">
            <input type="submit" name="返回" value="返回功能区">
        </form>
    </div>
</div>
</body>
</html>

3 编写 put.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String basePath =
            request.getScheme() + "://" +
                    request.getServerName() + ":" +
                    request.getServerPort() + request.getContextPath() + "/";
%>
<html>
<head>
    <title>修改学生信息</title>
    <style>
        div {
            background-color: antiquewhite;
            width: 300px;
            height: 180px;
            margin: 100px auto;
            text-align: center;
            line-height: normal;
            background-image: url("/images/p4.jpg");
            background-repeat: no-repeat;
        }
        .box2 {
            width: 80px;
            height: 25px;
            text-align: center;
            margin: auto;
        }
    </style>
</head>
<body>
<div>
    <h3>根据学号修改数据</h3>
    <form action="/student/put.do" method="post">
        学号:<input type="text" name="sid" value=""><br>
        姓名:<input type="text" name="sname" value=""><br>
        年龄:<input type="text" name="sage" value=""><br>
        <input type="submit" value="修改">
        <input type="reset" value="重置">
    </form>
    <%--返回到首页--%>
    <div class="box2">
        <form action="<%=basePath%>index.jsp">
            <input type="submit" name="返回" value="返回功能区">
        </form>
    </div>
</div>
</body>
</html>

4 编写 del.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String basePath =
            request.getScheme() + "://" +
                    request.getServerName() + ":" +
                    request.getServerPort() + request.getContextPath() + "/";
%>
<html>
<head>
    <title>删除学生信息</title>
    <style>
        div {
            background-color: beige;
            width: 300px;
            height: 150px;
            margin: 100px auto;
            text-align: center;
            background-image: url("/images/p2.jpg");
            background-repeat: no-repeat;
        }
        .box2 {
            width: 80px;
            height: 25px;
            text-align: center;
            margin: auto;
        }
    </style>
</head>
<body>
<div>
    <h3>根据学号删除数据</h3>
    <form action="/student/del.do" method="get">
        <input type="text" placeholder="请输入学号" name="sid" value="">
        <input type="submit" value="删除">
    </form>
    <%--返回到首页--%>
    <div class="box2">
        <form action="<%=basePath%>index.jsp">
            <input type="submit" name="返回" value="返回功能区">
        </form>
    </div>
</div>
</body>
</html>

5 编写success.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String basePath =
            request.getScheme() + "://" +
                    request.getServerName() + ":" +
                    request.getServerPort() + request.getContextPath() + "/";
%>
<html>
<head>
    <title>Title</title>
    <style>
        .box1{
            width: 200px;
            height: 150px;
            background-color: lightgoldenrodyellow;
            margin: 0 auto;
            text-align: center;
        }
    </style>
</head>
<body>
<div class="box1">
    <div class="box2">
        <div>插入:${data1}</div>
        <div>修改:${data2}</div>
        <div>删除:${data3}</div>
    </div>
    <%--返回到首页--%>
    <div>
        <form action="<%=basePath%>index.jsp">
            <input type="submit" name="返回" value="返回功能区">
        </form>
    </div>
</div>
</body>
</html>

4 运行访问

4.1 请求路径

首页:http://localhost:8080
SSM整合(XML方式),SSM,ssm

4.2 增删改查界面

  • 查询功能
    SSM整合(XML方式),SSM,ssm
  • 新增功能
    SSM整合(XML方式),SSM,ssm
  • 修改功能
    SSM整合(XML方式),SSM,ssm
  • 删除功能
    SSM整合(XML方式),SSM,ssm

4.3 项目源代码

https://gitee.com/allureyu/ssm__xml.git

以上纯属个人一手编写,欢迎指教,不喜勿喷!文章来源地址https://www.toymoban.com/news/detail-649742.html

到了这里,关于SSM整合(XML方式)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 【业务功能篇45】SSM整合shiro项目:web.xml执行顺序

    web.xml 的加载顺序是:ServletContext - context-param - listener - filter - servlet 学习shiro时,需要配置shiro ,我们需要在filter过滤器之前,先初始化好shiro组件,不然请求认证无法走到shiro,根据web.xml的加载顺序,listener标签中会先于filter标签中的组件,所以我们配置shiro的context文件,单独

    2024年02月16日
    浏览(44)
  • SSM学习记录9:SpringBoot整合SSM(注解方式)

    启动SpringBootDemoApplication↓ springBoot项目内含tomcat服务器,无需手动配置↓ 测试结果↓ 上下图来自黑马程序员的视频教程,点击查看教程 配置文件yml与yaml语法↓ 配置文件数据读取方式(3种)↓ 配置文件: 读取方式: 若自定义方式出现警告↓ Test加载的是同级目录下的类,

    2024年02月09日
    浏览(26)
  • SSM项目集成Spring Security 4.X版本(使用spring-security.xml 配置文件方式)

    目录 前言 实战开发: 一、Spring Security整合到SSM项目 1. pom文件引入包 2. web.xml 配置 3. 添加 spring-security.xml 文件 二、Spring Security实战应用 1. 项目结构 2. pom文件引入 3. web.xml 配置 4. Spring 配置 applicationContext.xml 5. spring-security.xml 配置 6. springmvc.xml 配置 7. 创建实体类 8. DAO层实

    2024年01月24日
    浏览(40)
  • SSM整合-Spring整合SringMVC、Mybatis,ssm测试

    ​ SSM(Spring + SpringMVC + Mybatis) 整合,就是三个框架协同开发。 Spring 整合 Mybatis,就是将 Mybatis 核心配置分拣当中数据源的配置、事务管理、工厂的配置、Mapper接口的实现类等 交给Spring进行管理。 mybatisConfig.xml配置信息 整合到 SpringConfig.xml Spring 整合 SpringMVC,就是在web.xml当中

    2023年04月22日
    浏览(40)
  • ssm项目/pom.xml

    用处:好像是附网址            “properties”是 Maven 项目中的一个配置项,用于设置项目的配置信息。 其中,“project.build.sourceEncoding”——用于设置构建过程中使用的字符编码,“maven.compiler.source”——用于设置编译器使用的源代码版本,              “maven.compiler

    2024年02月08日
    浏览(83)
  • 整合SSM框架 -- 简单基础SSM项目

    学完MyBatis、Spring、SpringMVC,做一个基于SSM框架的基础项目–书籍管理系统,要求可以实现数据的增删改查,业务运行逻辑明了,分层开发,用来巩固学习 目标: 配置SSM框架 实现基础的增删改查功能 具备后续方便的拓展功能 界面设计整洁 最终效果: 全部书籍页面 新增书籍

    2024年02月08日
    浏览(45)
  • SSM项目小例子,SSM整合图文详细教程

    今天来搭建一个SSM项目的小例子简单练一练,那项目模板还是我们那个模板,就是我们在JavaWeb最后的小例子,那到SSM中我们如何实现,后面我们再看看springboot中如何实现 javaweb中项目例子: https://blog.csdn.net/hello_list/article/details/124734814 首先我们来搭建一个SSM项目,同时也是

    2024年02月06日
    浏览(38)
  • SSM+Shiro安全框架整合(完成安全认证--登录+权限授权)+ssm整合shiro前后端分离

    目录 1.搭建SSM框架  1.1.引入相关的依赖 1.2. spring配置文件 1.3. web.xml配置文件 1.4.配置Tomcat并启动 2.ssm整合shiro---认证功能  (1).引入依赖 (2).修改spring配置文件 (3).修改web.xml文件 (4).新建login.jsp(登录页面) (5).新建success.jsp(登录成功后跳转到此) (6).创建User实体类 (7).创建LoginVo

    2024年02月15日
    浏览(37)
  • 【SpringMVC】SSM整合

    前面我们已经把 Mybatis 、 Spring 和 SpringMVC 三个框架进行了学习,今天主要的内容就是把这三个框架整合在一起完成我们的业务功能开发,具体如何来整合,我们一步步来学习。 1. 流程分析 (1) 创建工程 创建一个Maven的web工程 pom.xml添加SSM需要的依赖jar包 编写Web项目的入口配置

    2024年02月08日
    浏览(35)
  • 【SSM项目整合流程】

    目录 一.用Maven创建一个project项目 1.1新建一个项目,选择Maven然后点击下一步 1.2设置项目名称和AGV后点击完成 1.3在pom.xml文件中导入依赖和配置打包方式 二.添加web工程 2.1在Project Structure中型添加一个web工程 2.2配置web.xml 三.创建SpringMVC的配置文件 3.1配置SpringMVC.xml 四.搭建MyB

    2024年02月10日
    浏览(29)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包