当前位置: 首页 > 编程日记 > 正文

使用Spring的@Autowired 实现DAO, Service, Controller三层的注入(转)

简述:

结合Spring和Hibernate进行开发

使用@Autowired实现依赖注入, 实现一个学生注册的功能,做一个技术原型

从DAO(Repository) -> Service -> Controller

目录结构:

使用Maven做本地包管理,

pom.xml

[java] view plaincopy
  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">  
  2. <modelVersion>4.0.0</modelVersion>  
  3. <groupId>WebProject</groupId>
  4. <artifactId>StudentManagementWeb</artifactId>
  5. <version>0.0.1-SNAPSHOT</version>  
  6. <packaging>war</packaging>
  7. <name>StudentManagementWeb</name>
  8. <url>http://maven.apache.org</url>  
  9. <properties>
  10. <org.springframework.version>3.0.2.RELEASE</org.springframework.version>  
  11. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  
  12. </properties>
  13. <dependencies>
  14. <dependency>
  15. <groupId>junit</groupId>
  16. <artifactId>junit</artifactId>
  17. <version>3.8.1</version>  
  18. <scope>test</scope>
  19. </dependency>
  20. <!-- Project Requirements -->
  21. <dependency>
  22. <groupId>javax.servlet</groupId>
  23. <artifactId>servlet-api</artifactId>
  24. <version>2.5</version>  
  25. </dependency>
  26. <dependency>
  27. <groupId>org.slf4j</groupId>
  28. <artifactId>slf4j-log4j12</artifactId>
  29. <version>1.4.2</version>  
  30. </dependency>
  31. <dependency>
  32. <groupId>org.springframework</groupId>
  33. <artifactId>spring-beans</artifactId>
  34. <version>${org.springframework.version}</version>
  35. </dependency>
  36. <dependency>
  37. <groupId>org.springframework</groupId>
  38. <artifactId>spring-jdbc</artifactId>
  39. <version>${org.springframework.version}</version>
  40. </dependency>
  41. <dependency>
  42. <groupId>org.springframework</groupId>
  43. <artifactId>spring-web</artifactId>
  44. <version>${org.springframework.version}</version>
  45. </dependency>
  46. <dependency>
  47. <groupId>org.springframework</groupId>
  48. <artifactId>spring-webmvc</artifactId>
  49. <version>${org.springframework.version}</version>
  50. </dependency>
  51. <dependency>
  52. <groupId>org.springframework</groupId>
  53. <artifactId>spring-orm</artifactId>
  54. <version>${org.springframework.version}</version>
  55. </dependency>
  56. <dependency>
  57. <groupId>org.hibernate</groupId>
  58. <artifactId>hibernate-entitymanager</artifactId>
  59. <version>3.4.0.GA</version>  
  60. </dependency>
  61. <dependency>
  62. <groupId>org.hibernate</groupId>
  63. <artifactId>hibernate-envers</artifactId>
  64. <version>3.5.6-Final</version>  
  65. </dependency>
  66. <dependency>
  67. <groupId>taglibs</groupId>
  68. <artifactId>standard</artifactId>
  69. <version>1.1.2</version>  
  70. </dependency>
  71. <dependency>
  72. <groupId>javax.servlet</groupId>
  73. <artifactId>jstl</artifactId>
  74. <version>1.1.2</version>  
  75. </dependency>
  76. <dependency>
  77. <groupId>mysql</groupId>
  78. <artifactId>mysql-connector-java</artifactId>
  79. <version>5.1.10</version>  
  80. </dependency>
  81. <dependency>
  82. <groupId>commons-dbcp</groupId>
  83. <artifactId>commons-dbcp</artifactId>
  84. <version>20030825.184428</version>  
  85. </dependency>
  86. <dependency>
  87. <groupId>commons-pool</groupId>
  88. <artifactId>commons-pool</artifactId>
  89. <version>20030825.183949</version>  
  90. </dependency>
  91. <dependency>
  92. <groupId>cglib</groupId>
  93. <artifactId>cglib</artifactId>
  94. <version>2.2.2</version>  
  95. </dependency>
  96. <dependency>
  97. <groupId>org.aspectj</groupId>
  98. <artifactId>aspectjweaver</artifactId>
  99. <version>1.6.12</version>  
  100. </dependency>
  101. </dependencies>
  102. </project>



各文件如下:

Web.xml

[java] view plaincopy
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">  
  3. <display-name>StudentManagementWeb</display-name>
  4. <welcome-file-list>
  5. <welcome-file>StudentRegistration.jsp</welcome-file>
  6. </welcome-file-list>
  7. <resource-ref>
  8. <description>DB Connection</description>
  9. <res-ref-name>jdbc/smw</res-ref-name>
  10. <res-type>javax.sql.DataSource</res-type>
  11. <res-auth>Container</res-auth>
  12. </resource-ref>
  13. <context-param>
  14. <param-name>log4jConfigLocation</param-name>
  15. <param-value>/WEB-INF/log4j.properties</param-value>
  16. </context-param>
  17. <!-- Define LOG4J Listener -->
  18. <listener>
  19. <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>   
  20. </listener>
  21. <servlet>
  22. <!-- define the name of Servlet -->
  23. <servlet-name>dispatcherServlet</servlet-name>
  24. <!-- Servlet implementation class -->  
  25. <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>  
  26. <!-- initialize the context -->
  27. <init-param>
  28. <param-name>contextConfigLocation</param-name>
  29. <!-- load configuration -->
  30. <param-value>/WEB-INF/applicationContext.xml</param-value>
  31. </init-param>
  32. <!-- set loading priority -->
  33. <load-on-startup>1</load-on-startup>  
  34. </servlet>
  35. <servlet-mapping>
  36. <servlet-name>dispatcherServlet</servlet-name>
  37. <url-pattern>*.do</url-pattern>  
  38. </servlet-mapping>
  39. </web-app>


applicationContext.xml

[html] view plaincopy
  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"        
  4. xmlns:context="http://www.springframework.org/schema/context"       
  5. xmlns:aop="http://www.springframework.org/schema/aop"       
  6. 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-2.5.xsd
  9. http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
  10. http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
  11. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">  
  12. <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/>  
  13. <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">  
  14. <property name="configLocation">  
  15. <value>classpath:hibernate.cfg.xml</value>  
  16. </property>  
  17. </bean>  
  18. <!-- make spring look up annotation -->  
  19. <context:annotation-config/>  
  20. <context:component-scan base-package="smw.*"/>  
  21. <!-- configure the transaction management -->  
  22. <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">           
  23. <property name="sessionFactory">               
  24. <ref bean="sessionFactory" />           
  25. </property>       
  26. </bean>  
  27. <tx:annotation-driven transaction-manager="txManager" />  
  28. </beans>  

hibernate.cfg.xml

[java] view plaincopy
  1. <?xml version='1.0' encoding='UTF-8'?>  
  2. <!DOCTYPE hibernate-configuration PUBLIC
  3. "-//Hibernate/Hibernate Configuration DTD 3.0//EN"  
  4. "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">  
  5. <hibernate-configuration>
  6. <session-factory>
  7. <property name="connection.datasource">java:comp/env/jdbc/smw</property>  
  8. <property name="dialect">  
  9. org.hibernate.dialect.MySQLDialect
  10. </property>
  11. <property name="show_sql">true</property><!-- show sql statement -->  
  12. <!-- mapping files -->
  13. <mapping resource="smw/model/Student.hbm.xml"/>  
  14. </session-factory>
  15. </hibernate-configuration>

由于使用了Tomcat的数据源,所以还需要在Tomcat的Context.xml中添加数据库连接配置

context.xml(Tomcat server中文件,eclispe中在workspace中的server project中)

context.xml

[html] view plaincopy
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements.  See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License.  You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. --><!-- The contents of this file will be loaded for each web application --><Context>  
  16. <!-- Default set of monitored resources -->  
  17. <WatchedResource>WEB-INF/web.xml</WatchedResource>  
  18. <!-- Uncomment this to disable session persistence across Tomcat restarts -->  
  19. <!-- 
  20.     <Manager pathname="" /> 
  21.     -->  
  22. <!-- Uncomment this to enable Comet connection tacking (provides events
  23. on session expiration as well as webapp lifecycle) -->  
  24. <!-- 
  25.     <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" /> 
  26.     -->  
  27. <Resource name="jdbc/smw" auth="Container" type="javax.sql.DataSource"  
  28. maxActive="100" maxIdle="30" maxWait="10000"  
  29. username="root" password="sql" driverClassName="com.mysql.jdbc.Driver"  
  30. url="jdbc:mysql://localhost:3306/smw"/>  
  31. </Context>  

Student.java

[java] view plaincopy
  1. package smw.model;  
  2. public class Student {  
  3. private int sid;  
  4. private String name;  
  5. private String password;  
  6. private String college;  
  7. public int getSid() {  
  8. return sid;  
  9. }
  10. public void setSid(int sid) {  
  11. this.sid = sid;  
  12. }
  13. public String getName() {  
  14. return name;  
  15. }
  16. public void setName(String name) {  
  17. this.name = name;  
  18. }
  19. public String getPassword() {  
  20. return password;  
  21. }
  22. public void setPassword(String password) {  
  23. this.password = password;  
  24. }
  25. public String getCollege() {  
  26. return college;  
  27. }
  28. public void setCollege(String college) {  
  29. this.college = college;  
  30. }
  31. }


Student.hbm.xml (学生表的映射)

[java] view plaincopy
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"  
  3. "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">  
  4. <hibernate-mapping>
  5. <class name="smw.model.Student" table="tb_student" catalog="smw">  
  6. <id name="sid" column="sid" type="int">  
  7. <generator class="increment"/>  
  8. </id>
  9. <property name="name" type="java.lang.String">  
  10. <column name="name"  not-null="true" length="20">  
  11. <comment>student's name</comment>
  12. </column>
  13. </property>
  14. <property name="password" type="java.lang.String">  
  15. <column name="password"  not-null="false" length="10">  
  16. <comment>student's password</comment>
  17. </column>
  18. </property>
  19. <property name="college" type="java.lang.String">  
  20. <column name="college"  not-null="false" length="20">  
  21. <comment>student's college</comment>
  22. </column>
  23. </property>
  24. </class>  
  25. </hibernate-mapping>

IStudentDAO.java 

[java] view plaincopy
  1. package smw.dao;  
  2. import smw.model.Student;  
  3. public interface IStudentDAO {  
  4. /** 
  5.      * Save Student into database 
  6.      * @param student 
  7.      */  
  8. public void saveStudent(Student student);  
  9. }

StudentDAOImpl.java

[java] view plaincopy
  1. package smw.dao.impl;  
  2. import javax.annotation.Resource;  
  3. import org.hibernate.SessionFactory;  
  4. import org.springframework.orm.hibernate3.support.HibernateDaoSupport;  
  5. import org.springframework.stereotype.Repository;  
  6. import org.springframework.transaction.annotation.Transactional;  
  7. import smw.dao.IStudentDAO;  
  8. import smw.model.Student;  
  9. @SuppressWarnings("restriction")  
  10. @Repository("studentDAO")  
  11. @Transactional  
  12. public class StudentDAOImpl extends HibernateDaoSupport implements IStudentDAO{  
  13. @Resource(name="sessionFactory")  
  14. public void setSuperSessionFactory(SessionFactory sessionFactory){       
  15. super.setSessionFactory(sessionFactory);  
  16. }
  17. public void saveStudent(Student student){  
  18. getHibernateTemplate().save(student);
  19. }
  20. }


IStudentManagementService.java

[java] view plaincopy
  1. package smw.service;  
  2. import smw.model.Student;  
  3. public interface IStudentManagementService {  
  4. public void addStudent(Student student);  
  5. }

StudentManagementServiceImpl.java

[java] view plaincopy
  1. package smw.service.impl;  
  2. import org.springframework.beans.factory.annotation.Autowired;  
  3. import org.springframework.stereotype.Service;  
  4. import org.springframework.transaction.annotation.Propagation;  
  5. import org.springframework.transaction.annotation.Transactional;  
  6. import smw.dao.IStudentDAO;  
  7. import smw.model.Student;  
  8. import smw.service.IStudentManagementService;  
  9. @Service  
  10. public class StudentManagementServiceImpl implements IStudentManagementService {  
  11. @Autowired  
  12. private IStudentDAO studentDAO;  
  13. @Transactional(propagation=Propagation.REQUIRED)  
  14. public void addStudent(Student student) {  
  15. studentDAO.saveStudent(student);
  16. }
  17. }

StudentAction.java

[java] view plaincopy
  1. package smw.action;  
  2. import javax.servlet.http.HttpServletRequest;  
  3. import javax.servlet.http.HttpServletResponse;  
  4. import org.springframework.beans.factory.annotation.Autowired;  
  5. import org.springframework.stereotype.Controller;  
  6. import org.springframework.web.bind.annotation.RequestMapping;  
  7. import org.springframework.web.servlet.ModelAndView;  
  8. import org.springframework.web.servlet.mvc.multiaction.MultiActionController;  
  9. import smw.model.Student;  
  10. import smw.service.IStudentManagementService;  
  11. @Controller  
  12. @RequestMapping("StudentAction.do")  
  13. public class StudentAction extends MultiActionController{  
  14. @Autowired  
  15. private IStudentManagementService studentManagementService;  
  16. @RequestMapping(params = "method=HandleStudentRegistrationFormSubmit")  
  17. protected ModelAndView HandleStudentRegistrationFormSubmit(HttpServletRequest request  
  18. , HttpServletResponse response) {
  19. Student student = new Student();  
  20. String name = request.getParameter("name");  
  21. String password = request.getParameter("password");  
  22. String college = request.getParameter("college");  
  23. student.setName(name);
  24. student.setPassword(password);
  25. student.setCollege(college);
  26. studentManagementService.addStudent(student);
  27. return new ModelAndView("StudentRegistered.jsp");  
  28. }
  29. }

StudentRegistration.jsp

[java] view plaincopy
  1. <%@ page language="java" contentType="text/html; charset=GBK"  
  2. pageEncoding="ISO-8859-1"%>  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">  
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">  
  7. <title>User Registration</title>
  8. </head>
  9. <body>
  10. <h1 align="center">Student Registration Page</h1>  
  11. <form method="post" action="StudentAction.do?method=HandleStudentRegistrationFormSubmit" class="form">  
  12. <table width="280" border="0" align="center">  
  13. <tr>
  14. <td width="87" align="center" valign="middle" >  
  15. <div align="right">name:</div>  
  16. </td>
  17. <td width="183">  
  18. <label>
  19. <input name="name" type="text" id="name" maxlength="10" />  
  20. </label>
  21. <td>
  22. </tr>
  23. <tr>
  24. <td height="37" align="center" valign="middle">  
  25. <div align="right">password: </div>  
  26. </td>
  27. <td>
  28. <label>
  29. <input name="password" type="password" id="password" maxlength="20" />   
  30. </label>
  31. </td>
  32. </tr>
  33. <tr>
  34. <td height="37" align="center" valign="middle">  
  35. <div align="right">college: </div>  
  36. </td>
  37. <td>
  38. <label>
  39. <input name="college" type="text" id="college" maxlength="20" />   
  40. </label>
  41. </td>
  42. </tr>
  43. <tr>
  44. <td align="center" valign="middle">  
  45. <input type="submit" name="Submit" value="submit" />  
  46. </td>
  47. <td>
  48. <input name="reset" type="reset" id="reset" value="reset" />  
  49. </td>
  50. </tr>
  51. </table>
  52. </form>
  53. </body>
  54. </html>

StudentRegistered.jsp

[html] view plaincopy
  1. <%@ page language="java" contentType="text/html; charset=GBK"  
  2. pageEncoding="ISO-8859-1"%>  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">  
  4. <html>  
  5. <head>  
  6. <meta http-equiv="Content-Type" content="text/html; charset=GBK">  
  7. <title>User Registered</title>  
  8. </head>  
  9. <body>  
  10. <center>  
  11. <span class="STYLE2">Student Registered</span>  
  12. </center>  
  13. <br>  
  14. <table align="center" border="1">  
  15. <tr>  
  16. <td height="100"><span class="STYLE2">user name:</span></td>  
  17. <td height="100"><span class="STYLE2">${param.name }</span></td>  
  18. </tr>  
  19. <tr>  
  20. <td height="100"><span class="STYLE2">password:</span></td>  
  21. <td height="100"><span class="STYLE2">${param.password }</span></td>  
  22. </tr>  
  23. <tr>  
  24. <td height="100"><span class="STYLE2">college:</span></td>  
  25. <td height="100"><span class="STYLE2">${param.college }</span></td>  
  26. </tr>  
  27. <tr>  
  28. <td height="100" colspan="2" align="center"><href="StudentRegistration.jsp" class="STYLE2">return to registration</a></td>  
  29. </tr>  
  30. </table>  
  31. </body>  
  32. </html>  


结果:

跳转后,

数据库中新增记录,

http://blog.csdn.net/anialy/article/details/8251506

转载于:https://www.cnblogs.com/softidea/p/4486114.html

相关文章:

Ubuntu安装QT后无法输入中文怎么办?

文件目录打开&#xff1a; 文件位置/Qt5.12.6/Tools/QtCreator/lib/Qt/plugins/platforminputcontexts 查看是否存在libfcitxplatforminputcontextplugin.so库文件&#xff08;第一次装肯定没有&#xff09;放进去以后重新启动QT即可输入中文该库下载位置&#xff1a; ununtu…

Unity空间射击游戏开发教程

描述 在本课程中&#xff0c;您将学习如何在unity中制作一款太空射击游戏。本课程使用全新的特性和编码实践&#xff0c;并且兼容所有较新版本的unity。 了解如何使用世界领先的免费游戏开发工具Unity创建太空射击游戏。有了我们的在线教程&#xff0c;你会惊讶于创建这样一个…

43.放苹果(递归练习)

放苹果 总时间限制: 1000ms 内存限制: 65536kB 描述 把M个同样的苹果放在N个同样的盘子里&#xff0c;允许有的盘子空着不放&#xff0c;问共有多少种不同的分法&#xff1f;&#xff08;用K表示&#xff09;5&#xff0c;1&#xff0c;1和1&#xff0c;5&#xff0c;1 是同…

怎么彻底删除电脑上的软件_你的电脑有救了:1 个神器几个进阶方法彻底删除流氓软件!...

如何彻底删除流氓软件&#xff1f;https://www.zhihu.com/video/1064189630747844608流氓软件不仅会拖慢电脑的运行速度&#xff0c;还有各种烦人的广告和弹窗。哪怕你通过常规方式把它卸载掉了&#xff0c;它依然会卷土重来。因为一般的卸载可能会有文件残留&#xff0c;如何彻…

2022-2028年中国儿童保健品行业市场研究及前瞻分析报告

【报告类型】产业研究 【报告价格】4500起 【出版时间】即时更新&#xff08;交付时间约3个工作日&#xff09; 【发布机构】智研瞻产业研究院 【报告格式】PDF版 本报告介绍了中国儿童保健品行业市场行业相关概述、中国儿童保健品行业市场行业运行环境、分析了中国儿童保…

构造 Codeforces Round #302 (Div. 2) B Sea and Islands

题目传送门 1 /*2 题意&#xff1a;在n^n的海洋里是否有k块陆地3 构造算法&#xff1a;按奇偶性来判断&#xff0c;k小于等于所有点数的一半&#xff0c;交叉输出L/S4 输出完k个L后&#xff0c;之后全部输出S:)5 5 10 的例子可以是这样的&#xff…

QGC开发(一)---编译构建源码

编译构建源码编译信息下载QGC源码编译与构建编译信息 系 统&#xff1a;Ubuntu 16.04 QT 版 本&#xff1a;QT5.12.6 QGC版本&#xff1a;Stable_3.5.6下载QGC源码 下载连接&#xff1a; git clone https://github.com.cnpmjs.org/mavlink/qgroundcontrol.git -b St…

Unity 3D游戏开发学习教程

用C#用Unity3D制作游戏 你会学到: 您将学习3D游戏开发基础知识&#xff0c;以使用Unity3D引擎推进事物。 到本课程结束时&#xff0c;他们将可以轻松制作任何类型的游戏&#xff0c;无论是3D还是2D MP4 |视频:h264&#xff0c;1280720 |音频:AAC&#xff0c;44.1 KHz&#xf…

iphone照片永久删除怎么恢复_怎么恢复删除的照片?专业数据恢复软件轻松搞定...

怎么恢复删除的照片&#xff1f;照片相信对大家来说也都并不陌生&#xff0c;不管是旅游还是聚会&#xff0c;很多人往往也都会随手一拍&#xff0c;并将这些照片作为留恋。所以现在的生活中&#xff0c;用于拍照的设备也都越来越多&#xff0c;同时很多人对于所拍照片的清晰度…

知识点回顾-简单的TableView单组数据展示/多组数据展示

1 拖入TableView到UIView中,连线DataSource2 3 1.实现数据源方法4 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section5 {6 return ;7 }8 9 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSI…

2022-2028年中国多肽药物市场研究及前瞻分析报告

【报告类型】产业研究 【报告价格】4500起 【出版时间】即时更新&#xff08;交付时间约3个工作日&#xff09; 【发布机构】智研瞻产业研究院 【报告格式】PDF版 本报告介绍了中国多肽药物行业市场行业相关概述、中国多肽药物行业市场行业运行环境、分析了中国多肽药物行…

第一次写,测试下

2015年5月11日转载于:https://blog.51cto.com/tdfly/1650342

【转】ubuntu下实用的三款录屏软件

转发链接&#xff1a;https://www.cnblogs.com/cherishry/p/5710612.html 适用于日常办公&#xff01;

学习如何在AutoCad土木工程中绘制建筑设计图

学习如何在AutoCad中绘制建筑设计图从平面图到AutoCad土木工程中的整栋建筑 你会学到: 如何绘制房屋地图 如何绘制建筑设计 如何从AutoCad打印或出图 AutoCaD使用 AutoCaD命令使用 如何在2D Autocad中构建家庭或房屋地图(完整教程视频包括家庭地图、窗户、门、室内家具或物品、…

图像在计算机中通过什么方式表示_万物皆可“计算机视觉”

本文为 AI 研习社编译的技术博客&#xff0c;原标题 &#xff1a;How to do everything in Computer Vision作者 | George Seif翻译 | chesc、Disillusion、Ophria校对 | 邓普斯•杰弗 审核 | Lam-W 整理 | 菠萝妹原文链接&#xff1a;https://towardsdatascience.com/how-to-d…

2022-2028年中国电池制造行业市场供需规模及投资前景预测报告

【报告类型】产业研究 【报告价格】4500起 【出版时间】即时更新&#xff08;交付时间约3个工作日&#xff09; 【发布机构】智研瞻产业研究院 【报告格式】PDF版 本报告介绍了中国电池制造行业市场行业相关概述、中国电池制造行业市场行业运行环境、分析了中国电池制造行…

Ubuntu14.04 64bit 编译安装nginx1.7+php5.4+mysql5.6

我的操作系统是Ubuntu14.04&#xff0c;其它linux系统的操作流程类似。 主要安装的软件是nginx1.7php5.4mysql5.6 1. 创建必要目录 sudo mkdir ~/setup sudo mkdir /opt/software sudo chmod 777 /opt/software 2. 下载必要软件 cd ~/Downloadswget http://am1.php.net/distrib…

QGC注释消息提示框

消息提示框&#xff1a;有时显示时覆盖想要看的界面&#xff0c;可注释&#xff01;

学习编写Unity计算着色器 Learn to Write Unity Compute Shaders

利用图形处理器的力量 你会学到: 如何编写Unity计算着色器 如何在后处理图像过滤器中使用ComputeShaders 如何使用ComputeShaders进行粒子效果和群集 如何使用StructuredBuffers在计算着色器和实例表面着色器之间共享数据 使用计算机处理器处理流体模拟 使用计算机开发者创建物…

[重磅] 让HTML5达到原生的体验 系列之中的一个 避免切页白屏

非常多人都想、甚至曾使用HTML5开发跨平台App。而且想达到原生App的体验。最后的结果都是无奈的放弃。HTML5貌似美好&#xff0c;但坑太多。想做到原生App的体验差点儿不可为。 也曾有过著名的facebook放弃HTML5改用原生做App的事件。可是坑多不怕&#xff0c;就怕没人填。 本系…

测试中如何管理外包质量_如何从测试自动化中实现价值

如果几年前&#xff0c;质量管理部门都试图通过ROI指标来证明对测试的投资是合理的&#xff0c;那么现在情况发生了变化&#xff0c;是时候重新审视这个问题了。当实施连续测试&#xff0c;并且每天在不同的环境下以不同的角色运行多次测试自动化时&#xff0c;由于测量方法与以…

2022-2028年中国碘矿行业竞争格局分析及市场需求前景报告

【报告类型】产业研究 【报告价格】4500起 【出版时间】即时更新&#xff08;交付时间约3个工作日&#xff09; 【发布机构】智研瞻产业研究院 【报告格式】PDF版 本报告介绍了中国碘矿行业市场行业相关概述、中国碘矿行业市场行业运行环境、分析了中国碘矿行业市场行业的…

centos下axel安装与使用

一、获得Axel32位系统&#xff1a;wget -c http://www.centoscn.com/tool/axel-2.4-1.el5.rf.i386.rpm rpm -ivh axel-2.4-1.el5.rf.i386.rpm #安装64位系统&#xff1a;wget -c http://www.centoscn.com/tool/axel-2.4-1.el5.rf.x86_64.rpm rpm -ivh axel-2.4-1.el5.rf.x86_64…

Qt编译PX4源码,参考如下进行配置

参考链接&#xff1a; https://blog.csdn.net/qq_38768959/article/details/106822491如单独打开一个的话可以选择打开仿真编译套件&#xff0c;如需下载则选择下载套件&#xff01;

Unity三维游戏开发C#编程大师班 Masterclass In C# Programing Unity 3D Game Development FPS

本课程采用现代游戏开发(Unity 2021)的最新内容和最新技术 学习任何东西的最好方法是以一种真正有趣的方式去做&#xff0c;这就是这门课程的来源。如果你想了解你看到的这些不可思议的游戏是如何制作的&#xff0c;没有比这门课更好的起点了。我们确保本课程具备一切你需要的…

Integer.toHexString(b & 0xff)理解以及& 0xff什么意思

首先toHexString传的参数应该是int类型32位,此处传的是byte类型8位,所以前面需要补24个0。然后& 0xff 就是把前面24个0去掉只要后8位。toHexString(b & 0xff)相当于做了一次位的与运算,将前24位字符省略,将后8位保留。是两个十六进制的数,每个f用二进制表示是1111,所以占四位(bit),两个f()占八位(bit),八位(bit)也就是一个字节(byte).这个方法是把字节(转换成了int)以16进制的方式显示。我的理解是这样,如有不对欢迎指正!

DIV+CSS规范命名大全集合

网页制作中规范使用DIVCSS命名规则&#xff0c;可以改善优化功效特别是团队合作时候可以提供合作制作效率&#xff0c;具体DIV CSS命名规则CSS命名大全内容篇。 常用DIVCSS命名大全集合&#xff0c;即CSS命名规则 DIV CSS命名目录命名规则说明重要CSS命名CSS命名参考表命名技巧…

Java中的位运算符号详解(&、|、^、~、<<、>>、>>>)

(&&)在运算时,如果(&&)前面的表达式的结果为false,则(&&)后面的表达式就不会执行运算。(||)在运算时,如果(||)前面的表达式的结果为true,则(||)后面的表达式就不会执行运算。(&)在运算时,不论(&)前面的表达式的结果是否为false,(&)后面的表达式都会执行运算;(|)在运算时,不论(|)前面的表达式的结果是否为true,(|)后面的表达式都会执行运算;在Java中,(&)不仅可以作为位运算符号,同样也可以作为逻辑与符号,要注意:(||)并不是位运算符号,不可以参与位运算!

unity 200.8m yoy_专场分享会|大会最新Unity、中创文旅专场预告来啦!

北京国际游戏创新大会将于9月25日-27日分别在中华世纪坛发布厅、中华世纪坛剧场、京都信苑国际厅、京都信苑欧式厅、京都信苑圣马可厅、京都信苑第三会议室&#xff0c;6大场馆举办129场游戏行业主题分享&#xff0c;之前小编已经给大家介绍过腾讯、微软、完美世界、巨量引擎等…

2022-2028年中国碲化镉薄膜太阳能电池行业发展现状分析及投资前景趋势报告

【报告类型】产业研究 【报告价格】4500起 【出版时间】即时更新&#xff08;交付时间约3个工作日&#xff09; 【发布机构】智研瞻产业研究院 【报告格式】PDF版 本报告介绍了中国碲化镉薄膜太阳能电池行业市场行业相关概述、中国碲化镉薄膜太阳能电池行业市场行业运行环…