MyBatis3 association error - The content of element type resultMap must match (constructor?,id*,r...

MyBatis3 association error - The content of element type "resultMap" must match "(constructor?,id*,result*,association*,collection*,discriminator?)"

1.后台错误信息-问题现象:

ERROR [geby:Context initialization failed] 2013-02-19 10:41:59,968 [org.springframework.web.context.ContextLoader] -
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in ServletContext resource [/WEB-INF/classes/com/cobble/config/applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [com/cobble/config/sql-map-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException: The content of element type "resultMap" must match "(constructor?,id*,result*,association*,collection*,discriminator?)".
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1486)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:589)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1173)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1271)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:296)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [com/cobble/config/sql-map-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException: The content of element type "resultMap" must match "(constructor?,id*,result*,association*,collection*,discriminator?)".
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:380)
at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:295)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1545)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1483)
... 23 more
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException: The content of element type "resultMap" must match "(constructor?,id*,result*,association*,collection*,discriminator?)".
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:105)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:88)
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:374)
... 26 more
Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException: The content of element type "resultMap" must match "(constructor?,id*,result*,association*,collection*,discriminator?)".
at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:253)
at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:122)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.<init>(XMLMapperBuilder.java:74)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:310)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:103)
... 28 more
Caused by: org.xml.sax.SAXParseException: The content of element type "resultMap" must match "(constructor?,id*,result*,association*,collection*,discriminator?)".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2017)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:901)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1774)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2930)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:251)
... 32 more
2013-2-19 10:41:59 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in ServletContext resource [/WEB-INF/classes/com/cobble/config/applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [com/cobble/config/sql-map-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException: The content of element type "resultMap" must match "(constructor?,id*,result*,association*,collection*,discriminator?)".
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1486)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:589)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1173)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1271)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:296)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [com/cobble/config/sql-map-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException: The content of element type "resultMap" must match "(constructor?,id*,result*,association*,collection*,discriminator?)".
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:380)
at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:295)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1545)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1483)
... 23 more
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException: The content of element type "resultMap" must match "(constructor?,id*,result*,association*,collection*,discriminator?)".
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:105)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:88)
at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:374)
... 26 more
Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException: The content of element type "resultMap" must match "(constructor?,id*,result*,association*,collection*,discriminator?)".
at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:253)
at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:122)
at org.apache.ibatis.builder.xml.XMLMapperBuilder.<init>(XMLMapperBuilder.java:74)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:310)
at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:103)
... 28 more
Caused by: org.xml.sax.SAXParseException: The content of element type "resultMap" must match "(constructor?,id*,result*,association*,collection*,discriminator?)".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2017)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:901)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1774)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2930)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:251)
... 32 more

 

2.解决方法

方法:需要把[association]特性放在[result]特性后面。

3.对比mybatis-config.xml

  3.1)错误的xml【projectMapper.xml】

 1 <?xml version="1.0" encoding="UTF-8" ?>
 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 3 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 4 <mapper namespace="com.cobble.mapper.basicdoc.ProjectMapper">
 5     <!-- 定义结果集 -->
 6     <resultMap id="projectResultMap" type="ProjectPOJO">
 7         <id property="projectId" column="PROJECT_ID" />
 8         <association property="factoryPOJO" resultMap="com.cobble.mapper.basicdoc.FactoryMapper.factoryResultMap"/>
 9         <result property="projectName" column="PROJECT_NAME" />
10     </resultMap>
11 </mapper>

  3.2)正确的xml【projectMapper.xml】

<?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.cobble.mapper.basicdoc.ProjectMapper"><!-- 定义结果集 --><resultMap id="projectResultMap" type="ProjectPOJO"><id property="projectId" column="PROJECT_ID" /><result property="projectName" column="PROJECT_NAME" /><association property="factoryPOJO" resultMap="com.cobble.mapper.basicdoc.FactoryMapper.factoryResultMap"/></resultMap>
</mapper>

 

@cobble HF.AH.CHN 20130219

资料1:http://mybatis-user.963551.n3.nabble.com/How-to-fix-this-error-The-content-of-element-type-quot-association-quot-must-match-quot-constructor--td1981038.html#none

转载于:https://www.cnblogs.com/cobble19/archive/2013/02/19/2916768.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/376861.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Midjourney V6刷屏,但它最可怕的地方居然不是那些神图?

Midjourney在沉寂九个月后推出了Midjourney V6&#xff0c;这个文生图产品体现出的更细腻的细节处理&#xff0c;更强大的语言理解能力和更加“不像AI”的图片效果在过去几天引发一片惊呼。 作为一个闭源的模型产品&#xff0c;Midjourney的魔法配方并不为人所知&#xff0c;但…

HTTP 错误500.19 -Internal Server Error

HTTP 错误500.19 -Internal Server Error 原文:HTTP 错误500.19 -Internal Server Error HTTP 错误500.19 -Internal Server Error 错误代码 0x80070021 asp.net 2009-11-05 16:54:33 阅读484 评论1 字号&#xff1a;大中小 错误摘要 HTTP 错误500.19 -Internal Server Error …

连续内存分区式内存管理

目录前言分区式内存管理动态分区内存管理总结本笔记参考黄工的https://mp.weixin.qq.com/s/k0W_LqI1zBAYC1GU1U2HQA 前言 内存管理模块主要负责内存的初始化、分配以及释放。 从分配内存是否连续可以分为两大类&#xff1a; 1、连续内存管理 为进程分配的内存空间是连续的&a…

用DEVC++作图

小海豚学NOIP&#xff0c;老师说要用DEV C。 小海豚喜欢画图&#xff0c;记得以前用C#编些程序给她看。可前一阵打开看&#xff0c;我的免费Visual Studio过期了。可恶的Microsoft &#xff0c;不想用盗版难道就要每个月就下载一次&#xff1f; 于是就用DEV C的Windows调用吧。…

Python服务器开发三:Socket

Python服务器开发三&#xff1a;Socket socket是操作系统中I/O的延续&#xff0c;它可以使进程和机器之间的通信成为可能。socket可以看成一个标准的文件描述符。不同的是文件需要用open()函数打开&#xff0c;而socket用socket() 函数建立.recv()、send()函数和read()、write(…

Syntax error: Bad for loop variable解决办法

在Ubuntu下写的shell文件t.sh执行时出现错误&#xff1a; 1 t.sh: 6: Syntax error: Bad for loop variable 从ubuntu 6.10开始&#xff0c;ubuntu就将之前默认的bash shell更换成了dash shell&#xff0c;其表现为/bin/sh链接倒了/bin/dash&#xff0c;而不是传统的/bin/bash&…

Linux命令常见

摘自&#xff1a; 常考的 21 条 Linux 命令 目录&#xff09;cd,切换路径ls,查看文件与目录的命令cp,用于复制文件mv,用于移动文件、目录cat,查看文件内容find&#xff0c;文件搜索文件权限命令&#xff0c; 设置权限&#xff0c;-取消权限文本处理命令打包和压缩文件命令进程相…

记一次调试

这是我最近几个月来遇到的最棘手的一个问题&#xff1a;* 昨天花了4个小时找出第一层次的原因这个纠结啊&#xff0c;本来和老婆说好准时下班回家吃饭的&#xff0c;结果被这个问题拖了老久。这是一个gradle的plugin&#xff0c;用来resolve公司内部的dependency的&#xff0c;…

OSGi.NET 学习笔记 [模块化和插件化][小结]

【目录】-【模块化和插件化】-【小结】 现在我们来对OSGi.NET的“模块化和插件化”做一个小结&#xff0c;再次把官方的说明拿出来  1&#xff09; 物理隔离&#xff1a;基于UIOSP开发的模块是一个物理隔离的可单独部署的模块&#xff0c;每一个模块拥有独立的文件夹、类型空…

miniob :相关环境配置

How to build 参考视频&#xff1a;https://www.bilibili.com/video/BV1gv411A7oA?spm_id_from333.999.0.0将代码下载并且安装编译。 git clone失败的话参考&#xff1a;https://blog.csdn.net/sxg0205/article/details/81412921 install cmakebuild libevent git submodul…

Fedora 20 配置

前几天装了fedora 20, 断断续续的进行了以下配置&#xff1a; 1. 安装oracle java及jdk版本切换 安装的过程很简单&#xff0c;从oracle官网上下载jdk及jre的rpm包&#xff0c;使用rpm -ivh 安装。但是遇到一个问题&#xff0c;因为fedora系统自带了openJDK,如果安装oracle的jd…

raft算法学习(一):角色概念以及选举过程

Raft算法是强领导模型&#xff0c;集群中只能有一个领导。 下面是raft的视频讲解&#xff1a; raft raft的三种角色及其概念 服务器节点状态一共有三种&#xff1a;领导者&#xff08;Leader&#xff09;、跟随着&#xff08;Follower&#xff09;、候选人&#xff08;Candid…

解决 FLex 4.0 Module里面Alert.show();出错问题

TypeError: Error #1009: 无法访问空对象引用的属性或方法。 at mx.managers::PopUpManagerImpl/http://www.adobe.com/2006/flex/mx/internal::createModalWindow()[E:\dev\hero_private\frameworks\projects\framework\src\mx\managers\PopUpManagerImpl.as:701] at mx.manag…

datetime2 数据类型

.net的Entity Framework构建网站数据层&#xff0c;给一个实体的DATETIME类型的属性赋值时 突然莫名奇妙显示有一个类型不匹配的异常如下&#xff1a; System.Data.SqlClient.SqlException: 从 datetime2 数据类型到 datetime 数据类型的转换产生一个超出范围的值。 解决方法&a…

Yslow的A评级指南

这里测的是V2引擎&#xff0c;V1想拿A几乎不可能&#xff0c;一个CDN测试的F就可以轻松废了你的网站。 A评级 现在一个一个分析。 User fewer HTTP Requests&#xff1a;减少HTTP请求 图片、CSS、JS、flash等这些都需要增加http请求数&#xff0c;减少这些元素的数量能减少响应…

jquery下 选择器整理

jQuery 的选择器可谓之强大无比&#xff0c;这里简单地总结一下常用的元素查找方法 $("#myELement") 选择id值等于myElement的元素&#xff0c;id值不能重复在文档中只能有一个id值是myElement所以得到的是唯一的元素 $("div") 选择所有的di…

git日常使用教程

目录git日常使用git 基础用法(本地)git branchgit checkoutgit mergegit rebaseHEAD ,在提交树上移动相对引用强制修改分支位置撤销变更整理提交记录提交技巧Git TagsGit Describegit 基础用法(远程)git fetchgit pullgit push偏离的提交历史&#xff0c;十分重要&#xff01;&…

android一键分享功能不使用任何第三方sdk

在android中有自带的一键分享功能&#xff0c;不过它会把所有带分享的应用都找出来&#xff0c;如果我们只需要一些常见的分享应用&#xff0c;该如何做呢&#xff1f; 下面看我的效果图&#xff08;横屏和竖屏自动适配&#xff09;&#xff1a; 接下来看我的调用&#xff08;支…

包含EditText组件的界面中,禁止自动弹出软键盘

解决方法&#xff1a; 1&#xff09;在Manifest.xml文件中相应的activity下添加一下代码&#xff1a;android:windowSoftInputMode"stateHidden"2&#xff09;让EditText失去焦点&#xff0c;使用EditText的clearFocus方法 例如&#xff1a;EditText edit(EditText)f…

gcc 编译器使用指南

目录安装准备test.cpp编译g 编译参数-g &#xff1a;编译带调试信息的可执行文件-O[n] &#xff1a;开启优化-l 和 -L &#xff1a;指定库文件 | 指定库文件路径-I &#xff1a;指定头文件搜索目录-Wall 和 -w&#xff1a;打印警告信息 | 关闭警告信息-stdc11 &#xff1a;设置…