Spring+SpringMVC+Mybatis通过注解实现文章管理

在Java开发工程中,注解和XML混合使用已成为很多人和公司的首选了。

今天,我们来看一个功能模块,是本人小长假时,亲自动手实验的。当时想使用Spring+SpringMVC+Mybatis以注解的形式做一个人博客的,后来做了两个模块,实在是没有时间,就搁置了。目前实现了,对文章类型的管理和对文章的管理,这两个模块前段使用的时layui。现在,我们来看一下,这个项目的基本架构如图1。

Spring+SpringMVC+Mybatis通过注解实现文章管理

图1

看完架构了,我来看一下具体的配置吧,首先看一下web.xml的配置。

<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns="http://xmlns.jcp.org/xml/ns/javaee"

xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"

id="WebApp_ID" version="3.1">

<display-name>springmvc</display-name>

<listener>

<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

</listener>

<context-param>

<param-name>contextConfigLocation</param-name>

<param-value>classpath:application*.xml</param-value>

</context-param>

<servlet>

<description>springMVC核心控制器</description>

<servlet-name>servletDispatcher</servlet-name>

<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

<init-param>

<param-name>contextConfigLocation</param-name>

<param-value>classpath:sprin

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值