struts2+hibernate+spring配置详解

2023-11-09

在这里插入图片描述
#struts2+hibernate+spring配置详解
struts2+hibernate+spring配置详解

哎 ,当初一个人做好难,现在终于弄好了,希望自学这个的能少走些弯路。

以下是自己配置的案例
注意,要想明白的比较好,请下载这个配套的资料,献给初学者(这是获取资料的超链接,点击下载)
配置完成后
这里写图片描述

1,建立web项目ssh51
2,导入所有的jar包,包括Struts2,spring,hibernate
这里写图片描述
3.在项目下建立3个资源文件
这里写图片描述
4,建立持久化类和文件

package com.biluo.domain;

public class Person {
	private Integer id;
	private String  name;
	private String password;
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
}

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
        '-//Hibernate/Hibernate Mapping DTD 3.0//EN'
        'http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd'>

<hibernate-mapping package="com.biluo.domain">

    <class name="Person" table="person">
        <id name="id" type="java.lang.Integer" column="id">
        <!--generator用于指定主键的生成策略, hilo native increment sequence uuid  -->
           <generator class="native" />
        </id>

        <property name="name" type="java.lang.String" >
            <column name="name"  />
        </property>
          <property name="password" type="java.lang.String" >
            <column name="password"  />
        </property>
         
       
  	</class>

</hibernate-mapping>

5,在config目录下建立3个配置包 分别是 struts2 ,hibernate ,spring
这里写图片描述
6,建立一个hibernate.cfg.xml配置文件

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
	<!-- 一个sessionFactory代表数据库的一个连接 -->
<session-factory>

</session-factory>
</hibernate-configuration>

7.配置Spring,模块化
这里写图片描述
/ssh51/config/spring/applicationContext.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:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:ehcache="http://www.springmodules.org/schema/ehcache"
	xsi:schemaLocation="http://www.springframework.org/schema/beans   
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd  
           http://www.springframework.org/schema/context  
           http://www.springframework.org/schema/context/spring-context-2.5.xsd  
           http://www.springframework.org/schema/aop   
           http://www.springframework.org/schema/aop/spring-aop-2.5.xsd  
           http://www.springframework.org/schema/tx   
           http://www.springframework.org/schema/tx/spring-tx-2.5.xsd  
           http://www.springmodules.org/schema/ehcache  
           http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd">

	<import resource="applicationContext-db.xml"/><!-- 引入数据库配置文件 -->
	
	<import resource="applicationContext-people.xml"/><!-- 引入项模块 -->

</beans>

/ssh51/config/spring/applicationContext-db.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:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:ehcache="http://www.springmodules.org/schema/ehcache"
	xsi:schemaLocation="http://www.springframework.org/schema/beans   
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd  
           http://www.springframework.org/schema/context  
           http://www.springframework.org/schema/context/spring-context-2.5.xsd  
           http://www.springframework.org/schema/aop   
           http://www.springframework.org/schema/aop/spring-aop-2.5.xsd  
           http://www.springframework.org/schema/tx   
           http://www.springframework.org/schema/tx/spring-tx-2.5.xsd  
           http://www.springmodules.org/schema/ehcache  
           http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd">

	<!-- 按照指定的路径加载配置文件 -->
	<bean
		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="locations">
			<value>classpath:jdbc.properties</value>
		</property>
	</bean>

	<bean id="dataSource" destroy-method="close"
		class="org.apache.commons.dbcp.BasicDataSource">
		<property name="driverClassName" value="${jdbc.driverClassName}" />
		<property name="url" value="${jdbc.url}" />
		<property name="username" value="${jdbc.username}" />
		<property name="password" value="${jdbc.password}" />
	</bean>


</beans>

/ssh51/config/spring/applicationContext-people.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:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:ehcache="http://www.springmodules.org/schema/ehcache"
	xsi:schemaLocation="http://www.springframework.org/schema/beans   
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd  
           http://www.springframework.org/schema/context  
           http://www.springframework.org/schema/context/spring-context-2.5.xsd  
           http://www.springframework.org/schema/aop   
           http://www.springframework.org/schema/aop/spring-aop-2.5.xsd  
           http://www.springframework.org/schema/tx   
           http://www.springframework.org/schema/tx/spring-tx-2.5.xsd  
           http://www.springmodules.org/schema/ehcache  
           http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd">


</beans>

8,配置数据库连接参数,写在一个文件中比较科学
/ssh51/config/jdbc.properties

jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc\:mysql\://localhost\:3306/spring_hibernate
jdbc.username=root
jdbc.password=541711153

9,配置sessionFactory这个很重要
/ssh51/config/spring/applicationContext-db.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:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:ehcache="http://www.springmodules.org/schema/ehcache"
	xsi:schemaLocation="http://www.springframework.org/schema/beans   
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd  
           http://www.springframework.org/schema/context  
           http://www.springframework.org/schema/context/spring-context-2.5.xsd  
           http://www.springframework.org/schema/aop   
           http://www.springframework.org/schema/aop/spring-aop-2.5.xsd  
           http://www.springframework.org/schema/tx   
           http://www.springframework.org/schema/tx/spring-tx-2.5.xsd  
           http://www.springmodules.org/schema/ehcache  
           http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd">

	<!-- 按照指定的路径加载配置文件 -->
	<bean
		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="locations">
			<value>classpath:jdbc.properties</value>
		</property>
	</bean>

	<bean id="dataSource" destroy-method="close"
		class="org.apache.commons.dbcp.BasicDataSource">
		<property name="driverClassName" value="${jdbc.driverClassName}" />
		<property name="url" value="${jdbc.url}" />
		<property name="username" value="${jdbc.username}" />
		<property name="password" value="${jdbc.password}" />
	</bean>

	<bean id="sessionFactory"  class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
		<property name="dataSource"><ref bean="dataSource" /></property>
	
		
		<property name="mappingDirectoryLocations">
			<list>
				<value>classpath:com/biluo/domain</value><!-- 配置映射文件的路径 -->
			</list>
		</property>
		
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
				<!--控制台显示sql语句 -->
				<prop key="hibernate.show_sql">true</prop>
				<prop key="hibernate.format_sql">false</prop>
				<prop key="hibernate.hbm2ddl.auto">update</prop>
			</props>
		</property>
		
	</bean>
</beans>

10…好了,这里进入很重要的一步,必须测试,否者下面的不用看了,测试sessionfactory

package com.biluo.test;

import org.junit.Test;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SessionFactoryTest {
	
	@Test
	public void testSessionFactory(){
		ApplicationContext context = 
	new ClassPathXmlApplicationContext("spring/applicationContext.xml");
		context.getBean("sessionFactory");
	}
}

注意:这里要引入测试类,否者会报莫名其妙的错误
这一步,没做对的,就不要往下看了,一定要对了,才能继续

11.可以编写dao层,和service层了,这里要用接口编程,否者spring就没意义了,接口在 下面理解为代理对象

package com.biluo.dao;

import com.biluo.domain.Person;



public interface  PersonDao {
	public void savePerson(Person person);
}

package com.biluo.dao.impl;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.biluo.dao.PersonDao;
import com.biluo.domain.Person;

public class PersonDaoImpl extends HibernateDaoSupport implements PersonDao{

	public void savePerson(Person person) {
		// TODO Auto-generated method stub
		this.getHibernateTemplate().save(person);
	}

}

package com.biluo.service;

import com.biluo.domain.Person;

public interface PersonService {
	public void savePerson(Person person);
}

package com.biluo.service.impl;

import com.biluo.dao.PersonDao;

import com.biluo.domain.Person;
import com.biluo.service.PersonService;

public class PersonServiceImpl implements PersonService{

	private PersonDao personDao;
	


	public void setPersonDao(PersonDao personDao) {
		this.personDao = personDao;
	}



	public void savePerson(Person person) {
		// TODO Auto-generated method stub
		personDao.savePerson(person);
	}

}

12.下面要配置事务了

<?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:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:ehcache="http://www.springmodules.org/schema/ehcache"
	xsi:schemaLocation="http://www.springframework.org/schema/beans   
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd  
           http://www.springframework.org/schema/context  
           http://www.springframework.org/schema/context/spring-context-2.5.xsd  
           http://www.springframework.org/schema/aop   
           http://www.springframework.org/schema/aop/spring-aop-2.5.xsd  
           http://www.springframework.org/schema/tx   
           http://www.springframework.org/schema/tx/spring-tx-2.5.xsd  
           http://www.springmodules.org/schema/ehcache  
           http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd">

	<!-- 按照指定的路径加载配置文件 -->
	<bean
		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="locations">
			<value>classpath:jdbc.properties</value>
		</property>
	</bean>

	<bean id="dataSource" destroy-method="close"
		class="org.apache.commons.dbcp.BasicDataSource">
		<property name="driverClassName" value="${jdbc.driverClassName}" />
		<property name="url" value="${jdbc.url}" />
		<property name="username" value="${jdbc.username}" />
		<property name="password" value="${jdbc.password}" />
	</bean>

	<bean id="sessionFactory"  class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
		<property name="dataSource"><ref bean="dataSource" /></property>
	
		
		<property name="mappingDirectoryLocations">
			<list>
				<value>classpath:com/biluo/domain</value><!-- 配置映射文件的路径 -->
			</list>
		</property>
		
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
				<!--控制台显示sql语句 -->
				<prop key="hibernate.show_sql">true</prop>
				<prop key="hibernate.format_sql">false</prop>
				<prop key="hibernate.hbm2ddl.auto">update</prop>
			</props>
		</property>
		
	</bean>

	<!-- 这个不配置会默认提交事务的,而且不是经过代理对象,结果会被写到数据库的 -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
		<property name="sessionFactory">
			<ref bean="sessionFactory"/>
		</property>
	</bean>
	<tx:advice id="tx" transaction-manager="transactionManager">
		<tx:attributes>
			<tx:method name="save*"  propagation="NOT_SUPPORTED"  read-only="false"/>
		</tx:attributes>
	</tx:advice>
	<aop:config>
		<aop:pointcut expression="execution(* com.biluo.service.impl.PersonServiceImpl.*.*(..))" 
			id="perform"/>
		<aop:advisor advice-ref="tx" pointcut-ref="perform"/>
	</aop:config>

</beans>

13.配置applicationContext-person.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:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:ehcache="http://www.springmodules.org/schema/ehcache"
	xsi:schemaLocation="http://www.springframework.org/schema/beans   
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd  
           http://www.springframework.org/schema/context  
           http://www.springframework.org/schema/context/spring-context-2.5.xsd  
           http://www.springframework.org/schema/aop   
           http://www.springframework.org/schema/aop/spring-aop-2.5.xsd  
           http://www.springframework.org/schema/tx   
           http://www.springframework.org/schema/tx/spring-tx-2.5.xsd  
           http://www.springmodules.org/schema/ehcache  
           http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd">

	<bean id="personDao" class="com.biluo.dao.impl.PersonDaoImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory"/>
		</property>
	</bean>
	<bean id="personService" class="com.biluo.service.impl.PersonServiceImpl">
		<property name="personDao">
			<ref bean="personDao"/>
		</property>
	</bean>

	
</beans>

14.可以测试service和dao层了

package com.biluo.test;

import org.junit.Test;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.biluo.domain.Person;
import com.biluo.service.PersonService;

public class PersonServiceTest {
	@Test 
	public void testPersonService(){
		ApplicationContext context = 
new ClassPathXmlApplicationContext("spring/applicationContext.xml");
		PersonService personService = 
				(PersonService)context.getBean("personService");
		Person person = new Person();
		person.setName("aaa");
		personService.savePerson(person);
	}
}

这里写图片描述
15,建立action

package com.biluo.action;

import com.biluo.domain.Person;
import com.biluo.service.PersonService;
import com.opensymphony.xwork2.ActionSupport;

public class PersonAction extends ActionSupport {
	private PersonService personService;
	private Person person;

	
	public Person getPerson() {
		return person;
	}

	public void setPerson(Person person) {
		this.person = person;
	}
	public void setPersonService(PersonService personService) {
		this.personService = personService;
	}
	public String savePerson(){
		this.personService.savePerson(person);
		return "success";
		
	}
	
}

16,配置Action

<?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:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:ehcache="http://www.springmodules.org/schema/ehcache"
	xsi:schemaLocation="http://www.springframework.org/schema/beans   
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd  
           http://www.springframework.org/schema/context  
           http://www.springframework.org/schema/context/spring-context-2.5.xsd  
           http://www.springframework.org/schema/aop   
           http://www.springframework.org/schema/aop/spring-aop-2.5.xsd  
           http://www.springframework.org/schema/tx   
           http://www.springframework.org/schema/tx/spring-tx-2.5.xsd  
           http://www.springmodules.org/schema/ehcache  
           http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd">

	<bean id="personDao" class="com.biluo.dao.impl.PersonDaoImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory"/>
		</property>
	</bean>
	<bean id="personService" class="com.biluo.service.impl.PersonServiceImpl">
		<property name="personDao">
			<ref bean="personDao"/>
		</property>
	</bean>
	<bean id="personAction" class="com.biluo.action.PersonAction" 
		scope="prototype"><!-- scope="prototype"这一点要是,因为action是多个实例的 -->
		<property name="personService">
			<ref bean="personService"/>
		</property>
	</bean>
	
</beans>

17.添加struts配置文件,也要模块化
/ssh51/config/struts.xml

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

<!DOCTYPE struts PUBLIC
	"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
	"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
	
	<constant name="struts.il8n.encoding" value="UTF-8"	/>
	<constant name="struts.ui.theme" value="simple"/>
	<!-- <constant name="struts.devMode" value="true"/> -->
	
	<include file="struts2/struts-person.xml"></include>
	
	
</struts>
	



/ssh51/config/struts2/struts-person.xml

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

<!DOCTYPE struts PUBLIC
	"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
	"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
	
	<package name="default" namespace="/" extends="struts-default">
         <!--在Struts配置文件中配置action,但是他的class属性不再指向action的实现类
        	 ,而是指向spring容器的action实例的id
     	 --> 
         <action name="personAction_*" class="personAction" method="{1}">  
            <result name="input">/login.jsp</result> 
            <result name="success">/success.jsp</result> 
        </action> 
      
    </package>  
</struts>
	



18.配置web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 
	xmlns="http://java.sun.com/xml/ns/javaee" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
	http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
  <display-name></display-name>	
  
  <welcome-file-list>
		<welcome-file>login.jsp</welcome-file>
	</welcome-file-list>

	<!-- 配置spring资源 -->
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<!-- 这一点配错路径 会报这个错误No bean named 'sessionFactory ' is defined -->
		<param-value>classpath:/spring/applicationContext.xml</param-value>
	</context-param>

	<filter> 
   <filter-name>OpenSessionInViewFilter</filter-name> 
   <filter-class> 
    org.springframework.orm.hibernate3.support.OpenSessionInViewFilter 
   </filter-class> 
   <init-param> 
    <param-name>sessionFactoryBeanName</param-name> 
    <param-value>sessionFactory</param-value> 
   </init-param> 
   <init-param> 
            <param-name>singleSession</param-name> 
            <param-value>true</param-value>            
        </init-param> 
        <init-param> 
        <param-name>flushMode</param-name> 
   <param-value>AUTO</param-value>         
        </init-param> 
</filter> 

<filter-mapping> 
   <filter-name>OpenSessionInViewFilter</filter-name> 
   <url-pattern>/*</url-pattern> 
</filter-mapping> 
 
	<!-- 配置spring -->
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>


	<!--struts2的过滤器 -->
	<filter>
	<filter-name>struts2</filter-name> 
	<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> 
	</filter>
	<filter-mapping>
	<filter-name>struts2</filter-name> 
	<url-pattern>/*</url-pattern> 
	</filter-mapping>
	

</web-app>

19,编写jsp注册页面
/ssh51/WebRoot/login.jsp

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'login.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    
<form action="personAction_savePerson.action" method="post">
	<input type="text" name="person.name" value="${person.name}"/>
	<input type="password" name="person.password" value="${person.password}"/>
	<input type="submit" value="注册"/>
</form>


  </body>
</html>

/ssh51/WebRoot/success.jsp

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'success.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
   	 恭喜你  配置成功 <br>
  </body>
</html>

运行如果没有报错,而且jsp页面的数据被写入到数据库,就说明配置成功了

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

struts2+hibernate+spring配置详解 的相关文章

随机推荐

  • 接口测试工具-apipost

    apiost Postman Swagger Mock 功能特色 实现多人实时协作 接口自动化测试 选择接口 组成流程 执行流程 基于接口创建在线文档可分享 官网 Apipost API 文档 调试 Mock 测试一体化协作平台 API列表
  • 02.07_两个链表相交

    给你两个单链表的头节点 headA 和 headB 请你找出并返回两个单链表相交的起始节点 如果两个链表没有交点 返回 null 解法一 如果两个链表有相交 那么从后面看一定是相同的 所以只需要把长的移动到和短的链表一样的长度开始遍历即可
  • 低成本副业:开发小程序商城攻略

    随着互联网的普及和电子商务的兴起 越来越多的人选择做点副业 其中开发小程序商城是一个不错的选择 相比传统的实体店 小程序商城的成本更低 而且门槛更低 可以让更多的人参与到副业中来 那么 如何开发自己的小程序商城呢 下面为大家介绍步骤和技巧
  • STM32中遇到的问题--关于串口的一些常见问题

    在单片机的开发过程中 最常用的外设就是串口了 是用来进行bug纠错 log输出的常用工具 也是用来与外部通讯的常见协议之一 但是在使用串口的过程中难免会遇到一些问题 下面就我在工作遇到的一些问题做了一些记录 与大家分享 其实也是为了自己在以
  • [云原生专题-39]:K8S - 核心概念 - 存储抽象- pod配置文件的挂载ConfigMap

    作者主页 文火冰糖的硅基工坊 文火冰糖 王文兵 的博客 文火冰糖的硅基工坊 CSDN博客 本文网址 https blog csdn net HiWangWenBing article details 122856681 目录 前言 第1章
  • 安卓逆向入门指南:应用分析与反编译

    安卓逆向入门指南 应用分析与反编译 概述 简要介绍安卓逆向工程的基本概念和背景 解释逆向工程的目的和重要性 以及在安全审计和应用研究中的应用 应用分析 安卓应用文件结构的解析 介绍APK文件的结构 包括AndroidManifest xml
  • c#中new 后面大括号

    C new一个对象的时候 后面的参数不是用小括号吗 下面的大括号是怎么回事 不是数据为什么会用大括号 BarcodeWriter barcodeWriter new BarcodeWriter Format ZXing BarcodeFor
  • jmap、jstat、jinfo、jstack命令详解

    jmap jmap histo pid gt log txt 此命令可以用来查看内存信息 实例个数以及占用内存大小 num 序号 instances 实例数量 bytes 占用空间大小 class name 类名称 C is a char
  • Windows中.exe程序的启动过程和C/C++运行时库<转载>

    很是受益 Windows中 exe程序的启动过程和C C 运行时库 lt 转载 gt Windows系统中 exe后缀的文件一般可以双击运行 编程时 编译出来的最终结果一般也表现为一个exe程序和其他的为程序执行提供支持的dll 我们双击一
  • Unity3d-简单AR游戏

    Unity3d 简单AR游戏 一 图片识别与建模 Vufria模块的导入 首先是安装Vuforia 模块 2017版本后的可以直接使用Unity Hub安装 安装完成后可以直接在软件中使用 然后在菜单目录的GameObject gt Vuf
  • 利用docx4j word转pdf

    依赖
  • 不能导入当前目录下的py模块,不能导入自己写的包

    遇到一个很奇怪的问题 在jupyter里面 明明这个包就在当前目录下就是不能倒入 后来 发现os getcwd 返回的也不是当前文件所在目录 真是奇哉怪也 然后我在终端cd进去我要运行代码的目录 然后在 jupoyter notebook
  • 【计算机考研】从二本到浙大

    报名志愿 浙大 计算机科学与技术学院 软件工程专业 初试成绩 分数不高 大佬轻喷 以下学习方法仅供参考 小tip 放在前头 1 不要照搬别人的学习方案 马克思主义要中国化 学习也要个人化 学习是很私人的事情 一定要找到最适合自己的学习作息和
  • 关于IDEA中tomcat启动控制台乱码(server Tomcat Localhost Log Tomcat Catalina Log乱码)问题

    之前在网上查了好多 但好多都是乱改一通 没有实际效果 经过自己的几次试验后 终于找到了原因 希望可以帮助大家解决问题 少走些弯路 具体解释如下 在这之前说下 tomcat安装目录中 conf文件夹中的logging properties文件
  • linux vim配置

    vimrc config vim 配置 没有vimrc就之间创建新的 vi vimrc set nu 设置显示行号 set tabstop 4 shiftwidth 4 softtabstop 4 tab 等于四个空格 set expand
  • org.dom4j.DocumentException: null Nested exception: null解决

    org dom4j DocumentException null Nested exception null at org dom4j io SAXReader read SAXReader java 484 at org dom4j io
  • 【SpringCloud实战开发总结】

    Vue开发总结 1 Vue 开启Watch监听 2 on blur 3 disabled 4 InputNumber标签中的 max和 min 5 Select标签用于模糊查询 6 强制渲染的三种方法 7 增加下拉框宽度 8 vue前端校验
  • DHT11温湿度传感器编程详解

    一 DHT11介绍 DHT11数字温湿度传感器是一款含有已校准数字信号输出的温湿度复合传感器 采用专用的数字模块采集技术和温湿度传感技术 无需复杂的电路处理 传感器包括一个电阻式感湿元件和一个NTC测温元件 并与一个高性能8位单片机相连接
  • D3D初学入门一(配置开发环境及绘制D3D窗口)

    最近一直接触的都是C 的东东 好久没写C 代码了 怕手生忘记了 打算写写C 的代码 写什么好呢 想来想去 以前的工作学过接触了些OpenGL 那我就学习一下D3D吧 原以为D3D的中文入门资料会很多的 结果找了半天也没找到合适的 哎 随便将
  • struts2+hibernate+spring配置详解

    struts2 hibernate spring配置详解 struts2 hibernate spring配置详解 哎 当初一个人做好难 现在终于弄好了 希望自学这个的能少走些弯路 以下是自己配置的案例 注意 要想明白的比较好 请下载这个配