国产xxxx99真实实拍_久久不雅视频_高清韩国a级特黄毛片_嗯老师别我我受不了了小说

資訊專欄INFORMATION COLUMN

從零開始搭建SSM框架(Spring + Spring MVC + Mybatis)

MiracleWong / 3590人閱讀

摘要:打開,,選中,然后再選中,輸入項(xiàng)目的和,指定等配置,修改,打開項(xiàng)目,添加一些必要的目錄,最終項(xiàng)目框架目錄圖如下修改文件,指定各依賴和插件的版本等信息在標(biāo)簽里面管理各依賴的版本號(hào)添加項(xiàng)目依賴管理依賴配置好之后,開始整合。

最近在回顧和總結(jié)一些技術(shù),想到了把之前比較火的 SSM 框架重新搭建出來(lái),作為一個(gè)小結(jié),同時(shí)也希望本文章寫出來(lái)能對(duì)大家有一些幫助和啟發(fā),因本人水平有限,難免可能會(huì)有一些不對(duì)之處,歡迎各位大神拍磚指教,共同進(jìn)步。

本文章示例使用 IntelliJ IDEA 來(lái)開發(fā),JDK 使用 11 版本,其余各框架和技術(shù)基本上使用了文章撰寫當(dāng)時(shí)的最新版本。

好的,下面直接進(jìn)入正題。

打開 IntelliJ IDEA,F(xiàn)ile > New > Project > Maven,選中“Create from archetype”,然后再選中“org.apache.maven.archetypes:maven-archetype-webapp”:

Next,輸入項(xiàng)目的“GroupId”、“ArtifactId”和Version:

Next,指定“Maven home directory”等配置:

Next,修改Project Name:

Finish,打開項(xiàng)目,添加一些必要的目錄,最終項(xiàng)目框架目錄圖如下:

修改pom.xml文件,指定各依賴和插件的版本等信息:


    UTF-8

    11
    11
    11

    5.1.6.RELEASE
    4.12

    1.18.6

    3.1.1
    2.3.28
    1.1.16
    2.0
    8.0.16

    1.2
    4.0.1
    2.3.3

    2.9.2

    3.9
    2.9.8
    1.3.0.Final

    2.11.2
    1.7.26

    3.1.0
    3.1.0
    3.8.0
    3.0.0-M3
    3.2.2
    3.0.0-M1
    3.0.0-M1

標(biāo)簽里面管理各依賴的版本號(hào):


    
        
            org.springframework
            spring-context
            ${spring.version}
        
        
            org.springframework
            spring-context-support
            ${spring.version}
        
        
            org.springframework
            spring-beans
            ${spring.version}
        
        
            org.springframework
            spring-jdbc
            ${spring.version}
        
        
            org.springframework
            spring-aop
            ${spring.version}
        
        
            org.springframework
            spring-aspects
            ${spring.version}
        
        
            org.springframework
            spring-webmvc
            ${spring.version}
        
        
            org.springframework
            spring-test
            ${spring.version}
            test
        
        
            junit
            junit
            ${junit.version}
            test
        

        
            org.projectlombok
            lombok
            ${lombok.version}
            provided
        

        
            com.baomidou
            mybatis-plus
            ${mybatis-plus.version}
        
        
            com.baomidou
            mybatis-plus-generator
            ${mybatis-plus.version}
            test
            true
        
        
            org.freemarker
            freemarker
            ${freemarker.version}
            test
            true
        
        
            com.alibaba
            druid
            ${druid.version}
        
        
            com.github.jsqlparser
            jsqlparser
            ${jsqlparser.version}
        
        
            mysql
            mysql-connector-java
            ${mysql-connector.version}
        

        
            javax.servlet.jsp.jstl
            jstl-api
            ${jstl-api.version}
        
        
            javax.servlet
            javax.servlet-api
            ${servlet-api.version}
            provided
        
        
            javax.servlet.jsp
            javax.servlet.jsp-api
            ${jsp-api.version}
            provided
        

        
            io.springfox
            springfox-swagger2
            ${springfox-swagger.version}
        
        
            io.springfox
            springfox-swagger-ui
            ${springfox-swagger.version}
        

        
            org.apache.commons
            commons-lang3
            ${commons-lang3.version}
        
        
            com.fasterxml.jackson.core
            jackson-databind
            ${jackson.version}
        
        
            com.fasterxml.jackson.core
            jackson-annotations
            ${jackson.version}
            compile
        
        
            org.mapstruct
            mapstruct
            ${mapstruct.version}
        

        
            org.slf4j
            slf4j-api
            ${slf4j.version}
        
        
            org.apache.logging.log4j
            log4j-slf4j-impl
            ${log4j.version}
        
    

添加項(xiàng)目依賴:


    
        org.springframework
        spring-context-support
    
    
        org.springframework
        spring-jdbc
    
    
        org.springframework
        spring-aspects
    
    
        org.springframework
        spring-webmvc
    
    
        org.springframework
        spring-test
    
    
        junit
        junit
    

    
        org.projectlombok
        lombok
    

    
        com.baomidou
        mybatis-plus
    
    
        com.baomidou
        mybatis-plus-generator
    
    
        org.freemarker
        freemarker
    
    
        com.alibaba
        druid
    
    
        mysql
        mysql-connector-java
    

    
        javax.servlet.jsp.jstl
        jstl-api
    
    
        javax.servlet
        javax.servlet-api
    
    
        javax.servlet.jsp
        javax.servlet.jsp-api
    

    
        io.springfox
        springfox-swagger2
    
    
        io.springfox
        springfox-swagger-ui
    

    
        org.apache.commons
        commons-lang3
    
    
        com.fasterxml.jackson.core
        jackson-databind
    
    
        org.mapstruct
        mapstruct
    

    
        org.apache.logging.log4j
        log4j-slf4j-impl
    

管理


    ssm
    
        
            
                org.apache.maven.plugins
                maven-clean-plugin
                ${clean.plugin.version}
            
            
                org.apache.maven.plugins
                maven-resources-plugin
                ${resources.plugin.version}
                
                    ${project.build.sourceEncoding}
                
            
            
                org.apache.maven.plugins
                maven-compiler-plugin
                ${compiler.plugin.version}
                
                    ${maven.compiler.source}
                    ${maven.compiler.target}
                    ${project.build.sourceEncoding}
                    
                        
                            org.projectlombok
                            lombok
                            ${lombok.version}
                        
                        
                            org.mapstruct
                            mapstruct-processor
                            ${mapstruct.version}
                        
                    
                    
                        -Amapstruct.defaultComponentModel=spring
                        -Amapstruct.unmappedTargetPolicy=IGNORE
                    
                
            
            
                org.apache.maven.plugins
                maven-surefire-plugin
                ${surefire.plugin.version}
            
            
                org.apache.maven.plugins
                maven-war-plugin
                ${war.plugin.version}
            
            
                org.apache.maven.plugins
                maven-install-plugin
                ${install.plugin.version}
            
            
                org.apache.maven.plugins
                maven-deploy-plugin
                ${deploy.plugin.version}
            
        
    

依賴配置好之后,開始整合。

先整合Log4j2日志,在項(xiàng)目classpath目錄(src/main/resources)下創(chuàng)建log4j2.xml文件,添加Log4j2日志配置:



    
        
            
        
    
    
        
            
        
    

再整合 Spring 和 Mybatis,本次還整合了 Mybatis Plus 開源框架,新建 src/main/resources/mybatis/mybatis-config.xml 文件:




    
        
        
        
        
        
        
    
    
    
        
    

新建 src/main/resources/properties/jdbc.properties 文件,配置數(shù)據(jù)源連接信息:

jdbc.driverClassName=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://127.0.0.1:3306/ssm?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=GMT%2B8
jdbc.username=root
jdbc.password=root

新建 src/main/resources/spring/applicationContext-dao.xml 文件,配置 Druid 數(shù)據(jù)源,SqlSessionFactory 會(huì)話工廠,Mybatis 的 Mapper 接口掃描等信息:




    

    
    
    
        
            
                com.example.ssm.service.*
                com.example.ssm.mapper.*
            
        
    
    
        
    

    
    
        
        
        
    

    
    
        
    

    
    
        
        
        
    

    
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
            
                
                
                
            
        
        
    

    
    
        
        
        
        
        
            
                
                
                
                
            
        
    

    
    
        
        
    

新建 src/main/resources/spring/applicationContext-tx.xml 文件,配置事務(wù):




    

    
    
        
    

    

配置 Mybatis Plus 自動(dòng)生成 Controller、Service 和 Mapper 文件:

// 自動(dòng)代碼生成器
AutoGenerator autoGenerator = new AutoGenerator();

// 全局配置
GlobalConfig globalConfig = new GlobalConfig();
String projectPath = System.getProperty("user.dir");
globalConfig.setOutputDir(projectPath + "/src/main/java");
globalConfig.setAuthor("calvinit");
globalConfig.setOpen(false);
globalConfig.setFileOverride(true);
// Druid 1.1.16 版本貌似不支持 java8 新的時(shí)間類型,如 java.time.LocalDateTime
globalConfig.setDateType(DateType.ONLY_DATE);

autoGenerator.setGlobalConfig(globalConfig);

// 數(shù)據(jù)源配置
DataSourceConfig dataSourceConfig = new DataSourceConfig();
dataSourceConfig.setDbType(DbType.MYSQL);
dataSourceConfig.setUrl("jdbc:mysql://127.0.0.1:3306/ssm?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=GMT%2B8");
// dataSourceConfig.setSchemaName("public");
dataSourceConfig.setDriverName("com.mysql.cj.jdbc.Driver");
dataSourceConfig.setUsername("root");
dataSourceConfig.setPassword("root");

autoGenerator.setDataSource(dataSourceConfig);

// 包配置
PackageConfig packageConfig = new PackageConfig();
packageConfig.setParent("com.example.ssm");

autoGenerator.setPackageInfo(packageConfig);

// 自定義配置
InjectionConfig injectionConfig = new InjectionConfig() {
    @Override
    public void initMap() {
        // to do nothing
    }
};

// 如果模板引擎是 freemarker
String templatePath = "/templates/mapper.xml.ftl";

// 自定義輸出配置
List focList = new ArrayList<>();
// 自定義配置會(huì)被優(yōu)先輸出
focList.add(new FileOutConfig(templatePath) {
    @Override
    public String outputFile(TableInfo tableInfo) {
        tableInfo.setImportPackages("com.baomidou.mybatisplus.annotation.TableName");
        tableInfo.setConvert(true);
        // 自定義輸出文件名
        return projectPath + "/src/main/resources/mapper/"
                + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
    }
});

injectionConfig.setFileOutConfigList(focList);

autoGenerator.setCfg(injectionConfig);

// 配置模板
TemplateConfig templateConfig = new TemplateConfig();

// 配置自定義輸出模板
// templateConfig.setEntity(ConstVal.TEMPLATE_ENTITY_JAVA);
// templateConfig.setService(ConstVal.TEMPLATE_SERVICE);
// templateConfig.setController(ConstVal.TEMPLATE_CONTROLLER);
templateConfig.setXml(null);

autoGenerator.setTemplate(templateConfig);

// 策略配置
StrategyConfig strategy = new StrategyConfig();
strategy.setNaming(NamingStrategy.underline_to_camel);
strategy.setColumnNaming(NamingStrategy.underline_to_camel);
// strategy.setSuperEntityClass("com.example.ssm.entity.BaseEntity");
strategy.setEntityLombokModel(true);
strategy.setEntityColumnConstant(true);
strategy.setRestControllerStyle(true);
// strategy.setSuperControllerClass("com.example.ssm.controller.BaseController");
strategy.setInclude("t_user", "t_group", "t_user_group_relation");
// strategy.setSuperEntityColumns("id");
strategy.setControllerMappingHyphenStyle(true);
strategy.setTablePrefix(packageConfig.getModuleName() + "_");
strategy.setEntityTableFieldAnnotationEnable(true);

autoGenerator.setStrategy(strategy);
autoGenerator.setTemplateEngine(new FreemarkerTemplateEngine());
autoGenerator.execute();

然后整合 Spring 和 Spring MVC,其中對(duì)日期類型返回json作了自定義格式化處理:

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.module.SimpleModule;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;

/**
 * Jackson ObjectMapper 工廠類
 */
public class ObjectMapperFactory {

    public static ObjectMapper getMapper() {
        ObjectMapper objectMapper = new ObjectMapper();
        objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));

        SimpleModule module = new SimpleModule();
        module.addSerializer(LocalDate.class, new LocalDateSerializer());
        module.addSerializer(LocalTime.class, new LocalTimeSerializer());
        module.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer());

        objectMapper.registerModule(module);

        return objectMapper;
    }

    static class LocalDateSerializer extends JsonSerializer {

        private static final DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");

        /**
         * {@inheritDoc}
         */
        @Override
        public void serialize(LocalDate value, JsonGenerator jgen, SerializerProvider provider) throws IOException {
            jgen.writeString(dateFormatter.format(value));
        }
    }

    static class LocalDateTimeSerializer extends JsonSerializer {

        private static final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");

        /**
         * {@inheritDoc}
         */
        @Override
        public void serialize(LocalDateTime value, JsonGenerator jgen, SerializerProvider provider) throws IOException {
            jgen.writeString(dateTimeFormatter.format(value));
        }

    }

    static class LocalTimeSerializer extends JsonSerializer {

        private static final DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("HH:mm:ss");

        /**
         * {@inheritDoc}
         */
        @Override
        public void serialize(LocalTime value, JsonGenerator jgen, SerializerProvider provider) throws IOException {
            jgen.writeString(timeFormatter.format(value));
        }
    }
}

還集成了 Swgger UI ,方便接口調(diào)試:

import org.springframework.context.annotation.Bean;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@EnableSwagger2
public class Swagger2Configuration {

    @Bean("docket")
    public Docket createDocket() {
        return new Docket(DocumentationType.SWAGGER_2)
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.example.ssm.controller"))
                .paths(PathSelectors.any())
                .build()
                .apiInfo(apiInfo());
    }

    private ApiInfo apiInfo() {
        Contact contact = new Contact("calvinit", "https://gitee.com/calvinit/ssm-demo", "");
        return new ApiInfoBuilder()
                .title("SSM框架搭建Demo")
                .description("SSM框架搭建Demo,僅供猿友們學(xué)習(xí)交流之用,請(qǐng)勿用于商業(yè)用途")
                .contact(contact)
                .version("1.0-SNAPSHOT")
                .build();
    }
}

新建 src/main/resources/spring/spring-mvc.xml 文件:




    

    

    
    

    
        
            
                
                
                    
                        application/json;charset=UTF-8
                    
                
            
            
                
            
        
    

    
        
        
    

    
    
    
    

同時(shí)整合了MapStruct,方便 Entity、DTO 和 VO 等之間的轉(zhuǎn)換,使用示例:

import com.example.ssm.entity.User;
import com.example.ssm.vo.UserVo;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

@Mapper
public interface UserVoConverter {

    @Mappings({
            @Mapping(source = "id", target = "userId"),
            @Mapping(source = "name", target = "userName"),
            @Mapping(target = "createDt", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(target = "lastUpdateDt", dateFormat = "yyyy-MM-dd HH:mm:ss")
    })
    UserVo entityToVo(User user);

    List batchEntityToVo(List userList);

    @InheritInverseConfiguration
    User voToEntity(UserVo userVo);

    List batchVoToEntity(List userVoList);
}

新建 src/main/resources/spring/applicationContext-common.xml 文件,配置 MapStruct 的 bean 被 Spring 管理:




    

修改 web.xml 文件:




    ssm

    
    
        contextConfigLocation
        classpath:spring/applicationContext-*.xml
    
    
    
        log4jConfigLocation
        classpath:log4j2.xml
    

    
    
        characterEncodingFilter
        org.springframework.web.filter.CharacterEncodingFilter
        
            encoding
            UTF-8
        
    
    
        characterEncodingFilter
        /*
    

    
    
        druidWebStatFilter
        com.alibaba.druid.support.http.WebStatFilter
        
            exclusions
            *.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*
        
        
            profileEnable
            true
        
    
    
        druidWebStatFilter
        /*
    

    
        org.springframework.web.context.ContextLoaderListener
    

    
    
        dispatcherServlet
        org.springframework.web.servlet.DispatcherServlet
        
            contextConfigLocation
            classpath:spring/spring-mvc.xml
        
        1
    
    
        dispatcherServlet
        /
    

    
    
        druidStatView
        com.alibaba.druid.support.http.StatViewServlet
        
            
            allow
            127.0.0.1
        
        
            
            loginUsername
            user
        
        
            
            loginPassword
            password
        
        
            
            resetEnable
            true
        
    
    
        druidStatView
        /druid/*
    

    
        index.jsp
    

修改 index.jsp 文件:

<%@ page contentType="text/html;charset=UTF-8" %>


    ssm


Hello World!

打開 Swagger UI

至此,框架基本整合完畢,下面寫一個(gè)測(cè)試 Contoller 測(cè)試 Spring 和 Spring MVC 整合結(jié)果:

package com.example.ssm.controller;

import com.google.common.collect.Maps;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import springfox.documentation.annotations.ApiIgnore;

import java.util.Map;

@Api(tags = "首頁(yè)控制器")
@Controller
@RequestMapping
public class IndexController {

    @ApiIgnore
    @ApiOperation(value = "首頁(yè)")
    @GetMapping
    public String index() {
        return "index";
    }

    @ApiOperation(value = "返回純字符串")
    @GetMapping("/hello")
    @ResponseBody
    public String hello() {
        return "Hello World!";
    }

    @ApiOperation(value = "測(cè)試日期 json 返回")
    @GetMapping("/date/test")
    @ResponseBody
    public Map testDate() {
        Map map = Maps.newHashMap();

        map.put("java.util.Date", new java.util.Date());
        map.put("java.sql.Date", new java.sql.Date(System.currentTimeMillis()));
        map.put("java.time.LocalDate", java.time.LocalDate.now());
        map.put("java.time.LocalTime", java.time.LocalTime.now());
        map.put("java.time.LocalDateTime", java.time.LocalDateTime.now());

        return map;
    }
}

右上角“Add Configuration”添加 Tomcat 配置,將項(xiàng)目部署信息配置好:

然后我們啟動(dòng) Tomcat,打開 http://localhost:8080/ssm,如果正常,應(yīng)該顯示如下界面:

點(diǎn)擊界面上的超鏈接,進(jìn)入 Swagger UI 的界面。

再測(cè)試一下 Spring 和 Mybatis 整合是否完成:

package com.example.ssm.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.ssm.converter.UserVoConverter;
import com.example.ssm.entity.User;
import com.example.ssm.service.IUserService;
import com.example.ssm.vo.PageVo;
import com.example.ssm.vo.UserVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.lang.NonNull;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api
@RestController
@RequestMapping("/users")
public class UserController {

    private IUserService userService;
    private UserVoConverter userVoConverter;

    @Autowired
    public UserController(@NonNull IUserService userService, @NonNull UserVoConverter userVoConverter) {
        this.userService = userService;
        this.userVoConverter = userVoConverter;
    }

    @ApiOperation(value = "分頁(yè)查詢用戶列表")
    @GetMapping("/page")
    @ResponseBody
    public PageVo page(
            @ApiParam(value = "當(dāng)前頁(yè)", required = true, defaultValue = "1", example = "1")
            @RequestParam("pageNum") int pageNum,
            @ApiParam(value = "頁(yè)面大小", required = true, defaultValue = "10", example = "10")
            @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {

        Page page = new Page<>();
        page.setSize(pageSize);
        page.setCurrent(pageNum);
        page.setAsc(User.CREATE_DT, User.LAST_UPDATE_DT);

        IPage userPage = userService.selectPage(page);
        List userList = userPage.getRecords();
        List userVoList = userVoConverter.batchEntityToVo(userList);

        return new PageVo()
                .setPageNum(userPage.getCurrent())
                .setPageSize(userPage.getSize())
                .setPageTotal(userPage.getPages())
                .setRowTotal(userPage.getTotal())
                .setRowList(userVoList)
                .get();
    }

    @ApiOperation(value = "查詢某個(gè)用戶")
    @GetMapping("/{id}")
    @ResponseBody
    public User page(
            @ApiParam(value = "用戶Id", required = true, example = "1")
            @PathVariable(value = "id") int id) {

        return userService.selectByPrimaryKey(id);
    }

    @ApiOperation(value = "獲取所有00后用戶列表")
    @GetMapping("/00/list")
    @ResponseBody
    public List list00() {
        LambdaQueryWrapper userLambdaQueryWrapper = Wrappers.lambdaQuery();
        userLambdaQueryWrapper.ge(User::getBirthday, "2000-01-01");

        return userService.list(userLambdaQueryWrapper);
    }
}

在 Swagger UI 的界面里面測(cè)試接口,返回正確:

另外,Druid 的監(jiān)控信息頁(yè)面鏈接為:http://localhost:8080/ssm/druid/index.html,訪問(wèn)白名單、賬號(hào)和密碼在 web.xml 文件中配置。

至此,SSM 框架集成完畢,測(cè)試通過(guò)!

因篇幅關(guān)系,一些代碼并沒(méi)有在此文章中展現(xiàn),可到我的Gitee上看完整框架代碼。

文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請(qǐng)注明本文地址:http://specialneedsforspecialkids.com/yun/74383.html

相關(guān)文章

  • Java后端

    摘要:,面向切面編程,中最主要的是用于事務(wù)方面的使用。目標(biāo)達(dá)成后還會(huì)有去構(gòu)建微服務(wù),希望大家多多支持。原文地址手把手教程優(yōu)雅的應(yīng)用四手把手實(shí)現(xiàn)后端搭建第四期 SpringMVC 干貨系列:從零搭建 SpringMVC+mybatis(四):Spring 兩大核心之 AOP 學(xué)習(xí) | 掘金技術(shù)征文 原本地址:SpringMVC 干貨系列:從零搭建 SpringMVC+mybatis(四):Sp...

    joyvw 評(píng)論0 收藏0
  • SSM框架網(wǎng)站后臺(tái)搭建(一)

    摘要:傳統(tǒng)的代碼中,在類中調(diào)用其他對(duì)象,都是自己出來(lái)一個(gè)對(duì)象,然后調(diào)用,這樣代碼的耦合度就比較高。日志對(duì)象和主程序的耦合度降到最低,即使更改日志對(duì)象的操作,主程序不受影響。 SSM框架網(wǎng)站后臺(tái)搭建(一) 1.所用技術(shù)簡(jiǎn)單介紹 1.SSM中的S:Spring Spring在百度詞條上的解釋是: Spring是一個(gè)開放源代碼的設(shè)計(jì)層面框架,他解決的是業(yè)務(wù)邏輯層和其他各層的松耦合問(wèn)題,因此它將面向...

    ZweiZhao 評(píng)論0 收藏0
  • SSM框架運(yùn)行機(jī)制

    摘要:框架搭建首先下載相應(yīng)的包,對(duì)于包有兩種方式使用創(chuàng)建依賴從而導(dǎo)入所需的包。總結(jié)主要進(jìn)行頁(yè)面的請(qǐng)求接受與響應(yīng)。組件包括前端控制器,處理器映射器,處理器適配器,視圖解析器,處理器,視圖。 我之前的文章介紹了如何搭建SSH框架以及如何利用這一框架來(lái)進(jìn)行web應(yīng)用開發(fā),最近我又接觸了SSM框架即Spring+SpringMVC+Mybatis三大框架的整合,而且目前該框架就SSH框架而言使用的較...

    winterdawn 評(píng)論0 收藏0
  • 【Java】基于Maven搭建Spring+SpringMVC+Mybatis框架

    摘要:關(guān)于的配置,可以參考這篇文章的第一個(gè)小節(jié)配置模板引擎搭什么搭直接用腳手架不行嗎下載就能用下載就能用下載就能用碼云咳咳,開個(gè)玩笑,如果本著學(xué)習(xí)態(tài)度的話,那就慢慢啃吧搭建空的項(xiàng)目使用搭建基本的空項(xiàng)目填寫和,,選擇項(xiàng)目的地址,在新的窗口打開最 關(guān)于springMVC的配置,可以參考這篇文章的第一個(gè)小節(jié):【java】intellij idea SpringMVC 配置FreeMarker模板引...

    edagarli 評(píng)論0 收藏0

發(fā)表評(píng)論

0條評(píng)論

最新活動(dòng)
閱讀需要支付1元查看
<