本文是用来小结一下自己mybatis 和spring mvc 学习过程。 在写的过程中发现 http://www.phperz.com/article/15/0127/48684.html 这篇文章里面的Mybatis应用学习讲的不错,所以记录一下网址,如果自己写的太烂可以看这个。

在写的过程中发现http://www.cnblogs.com/rollenholt/p/3365866.html 写的也很好,看过很多这个博主的文章了,和他年纪差不多,真是难以望其项背啊...

1.使用spring mvc 与 Mybatis 组合的架构   首先需要导入相应的jar包

2.配置文件方面

spring mvc 需要   applicationContext.xml      xxxx-servlet.xml

Mybatis  需要在applicationContext.xml 中的一些配置   以及对应的xxxxMapper.xml

一个简单的applicationContext.xml如下所示

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
  4. xmlns:mvc="http://www.springframework.org/schema/mvc"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
  7. xsi:schemaLocation="http://www.springframework.org/schema/beans
  8. http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
  9. http://www.springframework.org/schema/context
  10. http://www.springframework.org/schema/context/spring-context-3.2.xsd
  11. http://www.springframework.org/schema/tx
  12. http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
  13. http://www.springframework.org/schema/mvc
  14. http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
  15. http://www.springframework.org/schema/aop
  16. http://www.springframework.org/schema/aop/spring-aop-3.2.xsd">
  17.  
  18. <!-- 扫描类包,将标注Spring注解的类自动转化Bean,同时完成Bean的注入 -->
  19. <context:component-scan base-package="novel.hr.user.Dao"/>
  20. <context:component-scan base-package="novel.hr.user.service"/>
  21. <context:component-scan base-package="novel.hr.user.control"/>
  22.  
  23. <!--扫描配置文件,读取配置文件中的信息 例如 ${jdbc.url} -->
  24. <context:property-placeholder location="/WEB-INF/classes/config/jdbcConfig.properties"/>
  25.  
  26. <!--数据源,配置的比较简单 -->
  27. <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
  28. destroy-method="close">
  29. <property name="driverClassName" value="${jdbc.driver}" />
  30. <property name="url" value="${jdbc.url}" />
  31. <property name="username" value="${jdbc.username}" />
  32. <property name="password" value="${jdbc.password}" />
  33. </bean>
  34.  
  35. <!--Mybatis的SessionFactory 在其中指定了数据源以及Mapper,xml配置文件的位置-->
  36. <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
  37. <property name="dataSource" ref="dataSource" />
  38. <property name="mapperLocations"
  39. value="/WEB-INF/classes/config/mybatismapper/*Mapper.xml" />
  40. </bean>
  41.  
  42. <!--MapperScanner,通过配置Scanner 和需要扫描的包,就可以将包中定义的mapper接口类注入到需要使用的地方,而不必手动实例化-->
  43. <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
  44. <property name="basePackage" value="novel.hr.user.Dao" />
  45. </bean>
  46.  
  47. <!-- ====事务相关控制===== 为事务管理器添加所要管理的数据源 -->
  48. <bean name="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  49. <property name="dataSource" ref="dataSource"></property>
  50. </bean>
  51.  
  52. <!-- advice 指定哪些方法需要事务管理 以及相应的配置-->
  53. <tx:advice id="userTxAdvice" transaction-manager="transactionManager">
  54. <tx:attributes>
  55. <tx:method name="delete*" propagation="REQUIRED" read-only="false"
  56. rollback-for="java.lang.Exception" no-rollback-for="java.lang.RuntimeException"/>
  57. <tx:method name="insert*" propagation="REQUIRED" read-only="false"
  58. rollback-for="java.lang.RuntimeException" />
  59. <tx:method name="update*" propagation="REQUIRED" read-only="false"
  60. rollback-for="java.lang.Exception" />
  61.  
  62. <tx:method name="find*" propagation="SUPPORTS"/>
  63. <tx:method name="get*" propagation="SUPPORTS"/>
  64. <tx:method name="select*" propagation="SUPPORTS"/>
  65. </tx:attributes>
  66. </tx:advice>
  67.  
  68. <!-- 定义aop的切入点 切入点按照expression来定义-->
  69. <aop:config>
  70. <aop:pointcut id="pc" expression="execution( * novelhr.user.service.*.*(..))" />
  71. <aop:advisor pointcut-ref="pc" advice-ref="userTxAdvice" />
  72. </aop:config>
  73.  
  74. <!--视图管理器 使spring mvc 返回string后自动加 前后缀,然后返回最终的视图 -->
  75. <bean
  76. class="org.springframework.web.servlet.view.InternalResourceViewResolver"
  77. p:viewClass="org.springframework.web.servlet.view.JstlView"
  78. p:prefix="/WEB-INF/view/"
  79. p:suffix=".jsp"
  80. />
  81. </beans>

配置了applicationContext之后,还需要配置xxx-servlet.xml  这个文件中的内容可以覆盖掉application中的配置。由于需要配置的基本在applicationContext中配置过了,所以这个的具体内容略过。

接下来的mapper的配置

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <!-- namespace 的值是接口的位置 -->
  4. <mapper namespace="novel.hr.user.Dao.UserManageMapper">
  5. <!-- 在select标签中编写查询的SQL语句, 设置select标签的id属性为getUser,id属性值必须是唯一的,不能够重复
  6. 使用parameterType属性指明查询时使用的参数类型,resultType属性指明查询返回的结果集类型
  7. resultType="me.gacl.domain.User"就表示将查询结果封装成一个User类的对象返回
  8. User类就是users表所对应的实体类
  9. -->
  10. <!--
  11. 根据id查询得到一个user对象
  12. -->
  13.  
  14. <select id="getUserCheck" parameterType="novel.hr.user.domain.Employee"
  15. resultType="novel.hr.user.domain.Employee">
  16. select * from Employee where EmployeeNum=#{employeeNum} and password=#{password}
  17. </select>
  18.  
  19. <!-- <update id="updateUser" parameterType="User" >
  20. update user set userName=#{userName},userAge=#{userAge},userAddress=#{userAddress} where id=#{id}
  21. </update>
  22. -->
  23. <!--seGeneratedKeys设置为"true"表明要MyBatis获取由数据库自动生成的主键;
  24. keyProperty="id"指定把获取到的主键值注入到Student的id属性-->
  25. <!-- <insert id="addUser" parameterType="User"
  26. useGeneratedKeys="true" keyProperty="id">
  27. insert into user(userName,userAge,userAddress) values(#{userName},#{userAge},#{userAddress})
  28. </insert>
  29.  
  30. <delete id="deleteUser" parameterType="int">
  31. delete from user where id=#{id}
  32. </delete>
  33.  
  34. -->
  35.  
  36. <!-- User 联合文章进行查询 方法之一的配置 (多对一的方式)
  37. <resultMap id="resultUserArticleList" type="Article">
  38. <id property="id" column="aid" />
  39. <result property="title" column="title" />
  40. <result property="content" column="content" />
  41.  
  42. <association property="user" javaType="User">
  43. <id property="id" column="id" />
  44. <result property="userName" column="userName" />
  45. <result property="userAddress" column="userAddress" />
  46. </association>
  47. </resultMap>
  48.  
  49. <select id="getUserArticles" parameterType="int" resultMap="resultUserArticleList">
  50. select user.id,user.userName,user.userAddress,article.id aid,article.title,article.content from user,article
  51. where user.id=article.userid and user.id=#{id}
  52. </select>-->
  53.  
  54. <!-- article 类中有一个user类的实例。也就是表的外键关系。有这个也可以看出一对一与一对多的方法,换成List就好
  55.  
  56. <resultMap id="resultUserArticleList" type="Article">
  57. <id property="id" column="aid" />
  58. <result property="title" column="title" />
  59. <result property="content" column="content" />
  60.  
  61. <association property="user" javaType="User">
  62. <id property="id" column="id" />
  63. <result property="userName" column="userName" />
  64. <result property="userAddress" column="userAddress" />
  65. </association>
  66. </resultMap>
  67.  
  68. <select id="getUserArticles" parameterType="int" resultMap="resultUserArticleList">
  69. select user.id,user.userName,user.userAddress,article.id aid,article.title,article.content from user,article
  70. where user.id=article.userid and user.id=#{id}
  71. </select>
  72. -->
  73.  
  74. <!-- 一对多的
  75. <resultMap type="User" id="resultListUser">
  76. <id column="id" property="id" />
  77. <result column="userName" property="userName" />
  78. <result column="userAge" property="userAge" />
  79. <result column="userAddress" property="userAddress" />
  80. </resultMap>
  81.  
  82. <resultMap id="resultUserArticleList-2" type="Article">
  83. <id property="id" column="aid" />
  84. <result property="title" column="title" />
  85. <result property="content" column="content" />
  86. <association property="user" javaType="User" resultMap="resultListUser" />
  87. </resultMap>
  88.  
  89. <select id="getUserArticles" parameterType="int" resultMap="resultUserArticleList">
  90. select user.id,user.userName,user.userAddress,article.id aid,article.title,article.content from user,article
  91. where user.id=article.userid and user.id=#{id}
  92. </select>
  93. -->
  94.  
  95. </mapper>

动态SQL的没用到,但是觉得肯定会有用,所以直接粘贴过来

  1. mybatis实战教程(mybatis in action)之八:mybatis 动态sql语句
  2. mybatis 的动态sql语句是基于OGNL表达式的。可以方便的在 sql 语句中实现某些逻辑. 总体说来mybatis 动态SQL 语句主要有以下几类:
  3. 1. if 语句 (简单的条件判断)
  4. 2. choose (when,otherwize) ,相当于java 语言中的 switch ,与 jstl 中的choose 很类似.
  5. 3. trim (对包含的内容加上 prefix,或者 suffix 等,前缀,后缀)
  6. 4. where (主要是用来简化sql语句中where条件判断的,能智能的处理 and or ,不必担心多余导致语法错误)
  7. 5. set (主要用于更新时)
  8. 6. foreach (在实现 mybatis in 语句查询时特别有用)
  9. 下面分别介绍这几种处理方式
  10.  
  11. 1. mybaits if 语句处理
  12.  
  13. <select id="dynamicIfTest" parameterType="Blog" resultType="Blog">
  14. select * from t_blog where 1 = 1
  15. <if test="title != null">
  16. and title = #{title}
  17. </if>
  18. <if test="content != null">
  19. and content = #{content}
  20. </if>
  21. <if test="owner != null">
  22. and owner = #{owner}
  23. </if>
  24. </select>
  25.  
  26. 这条语句的意思非常简单,如果你提供了title参数,那么就要满足title=#{title},同样如果你提供了ContentOwner的时候, 它们也需要满足相应的条件,之后就是返回满足这些条件的所有Blog,这是非常有用的一个功能,以往我们使用其他类型框架或者直接使用JDBC的时候, 如果我们要达到同样的选择效果的时候,我们就需要拼SQL语句,这是极其麻烦的,比起来,上述的动态SQL就要简单多了
  27.  
  28. 2.2. choose (when,otherwize) ,相当于java 语言中的 switch ,与 jstl 中的choose 很类似
  29.  
  30. <select id="dynamicChooseTest" parameterType="Blog" resultType="Blog">
  31. select * from t_blog where 1 = 1
  32. <choose>
  33. <when test="title != null">
  34. and title = #{title}
  35. </when>
  36. <when test="content != null">
  37. and content = #{content}
  38. </when>
  39. <otherwise>
  40. and owner = "owner1"
  41. </otherwise>
  42. </choose>
  43. </select>
  44. when元素表示当when中的条件满足的时候就输出其中的内容,跟JAVA中的switch效果差不多的是按照条件的顺序,当when中有条件满足的时 候,就会跳出choose,即所有的whenotherwise条件中,只有一个会输出,当所有的我很条件都不满足的时候就输出otherwise中的 内容。所以上述语句的意思非常简单, title!=null的时候就输出and titlte = #{title},不再往下判断条件,当title为空且content!=null的时候就输出and content = #{content},当所有条件都不满足的时候就输出otherwise中的内容。
  45.  
  46. 3.trim (对包含的内容加上 prefix,或者 suffix 等,前缀,后缀)
  47.  
  48. <select id="dynamicTrimTest" parameterType="Blog" resultType="Blog">
  49. select * from t_blog
  50. <trim prefix="where" prefixOverrides="and |or">
  51. <if test="title != null">
  52. title = #{title}
  53. </if>
  54. <if test="content != null">
  55. and content = #{content}
  56. </if>
  57. <if test="owner != null">
  58. or owner = #{owner}
  59. </if>
  60. </trim>
  61. </select>
  62.  
  63. trim元素的主要功能是可以在自己包含的内容前加上某些前缀,也可以在其后加上某些后缀,与之对应的属性是prefixsuffix;可以把包含内容 的首部某些内容覆盖,即忽略,也可以把尾部的某些内容覆盖,对应的属性是prefixOverridessuffixOverrides;正因为 trim有这样的功能,所以我们也可以非常简单的利用trim来代替where元素的功能
  64.  
  65. 4. where (主要是用来简化sql语句中where条件判断的,能智能的处理 and or 条件
  66.  
  67. <select id="dynamicWhereTest" parameterType="Blog" resultType="Blog">
  68. select * from t_blog
  69. <where>
  70. <if test="title != null">
  71. title = #{title}
  72. </if>
  73. <if test="content != null">
  74. and content = #{content}
  75. </if>
  76. <if test="owner != null">
  77. and owner = #{owner}
  78. </if>
  79. </where>
  80. </select>
  81. where元素的作用是会在写入where元素的地方输出一个where,另外一个好处是你不需要考虑where元素里面的条件输出是什么样子 的,MyBatis会智能的帮你处理,如果所有的条件都不满足那么MyBatis就会查出所有的记录,如果输出后是and 开头的,MyBatis会把第一个and忽略,当然如果是or开头的,MyBatis也会把它忽略;此外,在where元素中你不需要考虑空格的问 题,MyBatis会智能的帮你加上。像上述例子中,如果title=null content != null,那么输出的整个语句会是select * from t_blog where content = #{content},而不是select * from t_blog where and content = #{content},因为MyBatis会智能的把首个and 或 or 给忽略。
  82.  
  83. 5.set (主要用于更新时)
  84.  
  85. <update id="dynamicSetTest" parameterType="Blog">
  86. update t_blog
  87. <set>
  88. <if test="title != null">
  89. title = #{title},
  90. </if>
  91. <if test="content != null">
  92. content = #{content},
  93. </if>
  94. <if test="owner != null">
  95. owner = #{owner}
  96. </if>
  97. </set>
  98. where id = #{id}
  99. </update>
  100.  
  101. set元素主要是用在更新操作的时候,它的主要功能和where元素其实是差不多的,主要是在包含的语句前输出一个set,然后如果包含的语句是以逗号结束的话将会把该逗号忽略,如果set包含的内容为空的话则会出错。有了set元素我们就可以动态的更新那些修改了的字段
  102.  
  103. 6. foreach (在实现 mybatis in 语句查询时特别有用)
  104. foreach的主要用在构建in条件中,它可以在SQL语句中进行迭代一个集合。foreach元素的属性主要有 itemindexcollectionopenseparatorcloseitem表示集合中每一个元素进行迭代时的别名,index 定一个名字,用于表示在迭代过程中,每次迭代到的位置,open表示该语句以什么开始,separator表示在每次进行迭代之间以什么符号作为分隔 符,close表示以什么结束,在使用foreach的时候最关键的也是最容易出错的就是collection属性,该属性是必须指定的,但是在不同情况 下,该属性的值是不一样的,主要有一下3种情况:
  105. 如果传入的是单参数且参数类型是一个List的时候,collection属性值为list
  106. 如果传入的是单参数且参数类型是一个array数组的时候,collection的属性值为array
  107. 如果传入的参数是多个的时候,我们就需要把它们封装成一个Map了,当然单参数也可以封装成map,实际上如果你在传入参数的时候,在MyBatis里面 也是会把它封装成一个Map的,mapkey就是参数名,所以这个时候collection属性值就是传入的Listarray对象在自己封装的 map里面的key
  108.  
  109. 1.1.单参数List的类型
  110.  
  111. <select id="dynamicForeachTest" resultType="Blog">
  112. select * from t_blog where id in
  113. <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
  114. #{item}
  115. </foreach>
  116. </select>
  117.  
  118. 上述collection的值为list,对应的Mapper是这样的
  119.  
  120. public List<Blog> dynamicForeachTest(List<Integer> ids);
  121. 测试代码
  122.  
  123. @Test
  124. public void dynamicForeachTest() {
  125. SqlSession session = Util.getSqlSessionFactory().openSession();
  126. BlogMapper blogMapper = session.getMapper(BlogMapper.class);
  127. List<Integer> ids = new ArrayList<Integer>();
  128. ids.add(1);
  129. ids.add(3);
  130. ids.add(6);
  131. List<Blog> blogs = blogMapper.dynamicForeachTest(ids);
  132. for (Blog blog : blogs)
  133. System.out.println(blog);
  134. session.close();
  135. }
  136.  
  137. 2.数组类型的参数
  138.  
  139. <select id="dynamicForeach2Test" resultType="Blog">
  140. select * from t_blog where id in
  141. <foreach collection="array" index="index" item="item" open="(" separator="," close=")">
  142. #{item}
  143. </foreach>
  144. </select>
  145. 对应mapper
  146.  
  147. public List<Blog> dynamicForeach2Test(int[] ids);
  148.  
  149. 3. Map 类型的参数
  150.  
  151. <select id="dynamicForeach3Test" resultType="Blog">
  152. select * from t_blog where title like "%"#{title}"%" and id in
  153. <foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
  154. #{item}
  155. </foreach>
  156. </select>
  157.  
  158. mapper 应该是这样的接口:
  159.  
  160. public List<Blog> dynamicForeach3Test(Map<String, Object> params);
  161. 通过以上方法,就能完成一般的mybatis 动态SQL 语句.最常用的就是 if where foreach这几个,一定要重点掌握.

到此配置文件结束。在使用的时候代码如下

Dao接口

  1. package novel.hr.user.Dao;
  2.  
  3. public interface UserManagerDao {
  4.  
  5. Object getUserCheck(int EmployeeNum , String password);
  6. }

Mapper接口

  1. package novel.hr.user.Dao;
  2.  
  3. import novel.hr.user.domain.Employee;
  4.  
  5. public interface UserManageMapper {
  6.  
  7. Employee getUserCheck(Employee param);
  8. }

dao实现类

  1. @Repository
  2. public class UserManageDaoImpl implements UserManagerDao{
  3.  
  4. @Autowired
  5. private UserManageMapper umm;
  6.  
  7. @Override
  8. public Employee getUserCheck(int EmployeeNum , String password){
  9.  
  10. Employee param=new Employee();
  11. param.setEmployeeNum(EmployeeNum);
  12. param.setPassWord(password);
  13. return umm.getUserCheck(param);
  14. }
  15.  
  16. }

简单一点的可以直接用service层调用mapper接口,省略dao,因为mapper其实已经起到了dao的作用。

相对于学习Hibernate的过程,我觉得Mybatis更加简单易用一些。

如果有新的再加

Mybatis 与 spring mvc的更多相关文章

  1. OSGI企业应用开发(十五)基于Spring、Mybatis、Spring MVC实现一个登录应用

    前面文章中,我们已经完成了OSGI应用中Spring.Mybatis.Spring MVC的整合,本篇文章我们就在这个基础上来完成一个简单的登录应用,其中用户名和密码需要从数据库中查询. 前面文章中, ...

  2. OSGI企业应用开发(十四)整合Spring、Mybatis、Spring MVC

    作为一个企业级的Web应用,MVC框架是必不可少的.Spring MVC目前使用也比较广泛,本文就来介绍一下如何在OSGI应用中实现Spring.Mybatis.Spring MVC框架的整合,其中S ...

  3. Java基础-SSM之Spring和Mybatis以及Spring MVC整合案例

    Java基础-SSM之Spring和Mybatis以及Spring MVC整合案例 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 能看到这篇文章的小伙伴,详细你已经有一定的Java ...

  4. MyBatis整合Spring MVC

    前面几篇文章已经讲到了mybatis与spring 的集成.目前主流的Web MVC框架,除了Struts这个主力外,还有Spring MVC,主要是由于 Spring MVC 配置比较简单,使用起来 ...

  5. mybatis :与Spring MVC 的集成

    用mybatis与Spring mvc 的方式集成起来,源码在本文结尾处下载.主要有以下几个方面的配置1. web.xml 配置 spring dispatchservlet ,比如为:mvc-dis ...

  6. MyBatis整合Spring MVC(易百教程)

    MyBatis是ibatis的升级版,作为hibernate的老对手,它是一个可以自定义SQL.存储过程和高级映射的持久层框架.与Hibernate 的主要区别就是 Mybatis 是半自动化的,而 ...

  7. Java框架搭建-Maven、Mybatis、Spring MVC整合搭建

    1. 下载eclipse 到网站下载 http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/marsr 选择 ...

  8. 搭建Spring + SpringMVC + Mybatis框架之三(整合Spring、Mybatis和Spring MVC)

    整合Spring和SpringMVC 之前已经整合了spring和mybatis,现在在此基础上整合SSM. 项目目录: 思路:SpringMVC的配置文件独立,然后在web.xml中配置整合. (1 ...

  9. mybatis和spring mvc整合

    1.环境 a.  jar包 (mybatis+spring mvc运行包+两者整合包mybatis-spring.jar) b.工程目录 c. 配置文件 mybatis:SqlMapConfig.xm ...

随机推荐

  1. Android LocalBroadcastManager 与 BroadcastReceiver

    Android中BroadcastReceiver主要用途有 发送通知,更新UI或者数据,应用程序间相互通信,监听系统状态(比如开机,网络等) Android中发送广播的方式: 普通广播:无论优先级大 ...

  2. [知识点]A*搜索(启发式搜索)

    // 此博文为迁移而来,写于2015年4月4日,不代表本人现在的观点与看法.原始地址:http://blog.sina.com.cn/s/blog_6022c4720102vwud.html 1.前言 ...

  3. 【POJ】2151 Check the difficulty of problems

    http://poj.org/problem?id=2151 题意:T个队伍M条题目,给出每个队伍i的每题能ac的概率p[i][j],求所有队伍至少A掉1题且冠军至少A掉N题的概率(T<=100 ...

  4. URAL 1287. Mars Canals

    题目链接 这题挺水,看懂了,就OK.卡了几下内存,还是卡过了. #include <iostream> #include <cstdio> #include <cstri ...

  5. USACO 5.5 Hidden Password(搜索+优化)

    水了好几下. 优化1:开始初始化的时候,如果左边那个也是最小值,那么此点就不用进队了. 优化2:如果队列里的位置,已经超过了后面位置的初始位置,那么后面这个位置也没用了. /* ID: cuizhe ...

  6. 为什么C#不使用多继承?(from stackoverflow)

    简单地说:是因为该语言的设计者决定不使用. 基本上,.NET和Java的设计者不使用多继承(MI),是因为他们认为给语言加上多继承获得的好处较少,抵不上因此增加的复杂性. 1.不同的语言对于多继承如何 ...

  7. Java_动态加载类(英文)

    It is possible to load and reload classes at runtime in Java, though it is not as straightforward as ...

  8. Java_Java SE6调用动态编译

    转自:http://www.cnblogs.com/flyoung2008/archive/2011/11/14/2249017.html 一.使用JavaCompiler接口编译java源程序 我们 ...

  9. python rabbitmq

    #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: zengchunyun ""& ...

  10. php by oneself

    在php里面写html代码真的很麻烦,最近学到了一个新的方法: <html> <head> <title>PHP</title> <meta ht ...