springmvc 整合 mybitas 的框架 没有在xml里配置sql,直接在mapper和sqlprovider里怎么实现增删改查

多表关联查询和插入怎么写?求大神帮助
2025-04-29 16:31:27
推荐回答(1个)
回答1:

不说了多了 直接上代码 首先是从程序的入口开始说:
web.xml


xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

index.jsp




20




contextConfigLocation
classpath:config/spring.xml;classpath:config/spring-myBatis.xml



org.springframework.web.context.ContextLoaderListener



org.springframework.web.util.IntrospectorCleanupListener




filterEncoding
org.springframework.web.filter.CharacterEncodingFilter

encoding
utf-8




filterEncoding
/




verifyCode
com.longhang.tool.verifyCode.VerifyCodeServlet




DispatcherServlet
org.springframework.web.servlet.DispatcherServlet

contextConfigLocation
classpath:config/springMVC-config.xml

1



verifyCode
/verifyCode



DispatcherServlet
*.do



springMVC的配置文件




xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"

xmlns:context="http://www.springframework.org/schema/context"

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd

http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd

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












spring.xml的配置









spring-myBatis.xml配置