最全手把手教你搭建SSM框架(Eclipse版),一文轻松搞定

总结

无论是哪家公司,都很重视高并发高可用的技术,重视基础,重视JVM。面试是一个双向选择的过程,不要抱着畏惧的心态去面试,不利于自己的发挥。同时看中的应该不止薪资,还要看你是不是真的喜欢这家公司,是不是能真的得到锻炼。其实我写了这么多,只是我自己的总结,并不一定适用于所有人,相信经过一些面试,大家都会有这些感触。

最后我整理了一些面试真题资料,技术知识点剖析教程,还有和广大同仁一起交流学习共同进步,还有一些职业经验的分享。

面试了阿里,滴滴,网易,蚂蚁,最终有幸去了网易【面试题分享】

本文已被CODING开源项目:【一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码】收录

需要这份系统化的资料的朋友,可以点击这里获取

/*

springMvc

org.springframework.web.servlet.DispatcherServlet

contextConfigLocation

classpath:springmvc.xml

1

springMvc

/

完成web.xml的配置后,在前面建好的resources文件夹下新建application.xml,具体解释看文件内部。

<?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:tx=“http://www.springframework.org/schema/tx”

xsi:schemaLocation="http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans-3.1.xsd

http://www.springframework.org/schema/context

http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">

<context:component-scan base-package=“com.cya”/>

<bean id=“propertyConfigurer”

class=“org.springframework.beans.factory.config.PropertyPlaceholderConfigurer”>

classpath:dbconfig.properties

<bean id=“dataSource” class=“com.alibaba.druid.pool.DruidDataSource”

destroy-method=“close”>

<bean id=“transactionManager”

class=“org.springframework.jdbc.datasource.DataSourceTransactionManager”>

<tx:annotation-driven transaction-manager=“transactionManager”/>

接着在resources文件夹下新建springmvc.xml,代码如下:

<?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

http://www.springframework.org/schema/mvc/spring-mvc.xsd">

<context:component-scan base-package=“com.cya.controller” />

<mvc:annotation-driven />

<bean id=“multipartResolver”

class=“org.springframework.web.multipart.commons.CommonsMultipartResolver”>

同上面的步骤,继续在resources文件夹下新建mybatis.xml和dbconfig.properties。

mybatis.xml文件:

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

dbconfig.properties文件:

jdbc.driver=com.mysql.jdbc.Driver

jdbc.url=jdbc:mysql://localhost:3306/test?characterEncoding=utf-8

jdbc.username=root

jdbc.password=

至此,所有的整合步骤已经完成了,最后的目录结构如下所示,接下来就是设计测试用例了。

在这里插入图片描述

5、测试Web能否正常运行


完成上述步骤后,接下来就测试下整合是否成功吧!

在WebContent文件夹下新建test.jsp。

<%@ page language=“java” contentType=“text/html; charset=utf-8”

pageEncoding=“utf-8”%>

测试SSM整合

获取Person信息

新建数据库test,在test库中建表person(id,name,age)

在这里插入图片描述

在src–>com.cya.entity下创建Person.java实体类

package com.cya.entity;

public class Person {

private int id;

private String name;

private int age;

public int getId() {

return id;

}

public void setId(int id) {

this.id = id;

}

public String getName() {

return name;

}

public void setName(String name) {

this.name = name;

}

public int getAge() {

return age;

}

public void setAge(int age) {

this.age = age;

}

}

在src–>com.cya.mapper下创建IPersonMapper.java接口和IPersonMapper.xml。注:这两个文件名必须要一致!

IPersonMapper.java接口:

package com.cya.mapper;

import java.util.List;

import com.cya.entity.Person;

public interface IPersonMapper {

public List getPerson();

}

IPersonMapper.xml配置文件:

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

select * from person

最后

手绘了下图所示的kafka知识大纲流程图(xmind文件不能上传,导出图片展现),但都可提供源文件给每位爱学习的朋友

image.png

本文已被CODING开源项目:【一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码】收录

需要这份系统化的资料的朋友,可以点击这里获取

pper namespace=“com.cya.mapper.IPersonMapper”>

select * from person

最后

手绘了下图所示的kafka知识大纲流程图(xmind文件不能上传,导出图片展现),但都可提供源文件给每位爱学习的朋友

[外链图片转存中…(img-ZiWNtZkq-1715604639211)]

本文已被CODING开源项目:【一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码】收录

需要这份系统化的资料的朋友,可以点击这里获取

  • 23
    点赞
  • 30
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值