beans.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"
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"> <!-- 读取jdbc.properties里的配置信息 -->
<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> <!-- xml方式配置sessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="mappingResources">
<list>
<value>com/anllin/usermgr/model/User.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop>
</props>
</property>
</bean> <!-- 开启事务管理 -->
<bean id="txManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean> <!-- spring事务的xml配置 ,建议使用-->
<aop:config>
<aop:pointcut id="bussinessService"
expression="execution(* com.anllin.usermgr.service..*.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="bussinessService" />
</aop:config> <!-- 对不同的方法进行不同的事务管理 -->
<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<tx:method name="get*" read-only="true"/>
<tx:method name="isExists*" read-only="true"/>
<tx:method name="*" propagation="REQUIRED" read-only="false" />
</tx:attributes>
</tx:advice> <!-- UserDaoImpl继承 HibernateDaoSupport,即可使用hibernateTemplate-->
<bean id="userDao" class="com.anllin.usermgr.dao.impl.UserDaoImpl">
<property name="sessionFactory" ref="sessionFactory"/>
</bean> <bean id="userService" class="com.anllin.usermgr.service.impl.UserServiceImpl">
<property name="userDao" ref="userDao"/>
</bean> <bean id="listUsersAction" class="com.anllin.usermgr.action.ListUserAction">
<property name="userService" ref="userService"/>
</bean> <bean id="addUserAction" class="com.anllin.usermgr.action.AddUserAction">
<property name="userService" ref="userService"/>
</bean> <bean id="deleteUserAction" class="com.anllin.usermgr.action.DeleteUserAction">
<property name="userService" ref="userService"></property>
</bean> <bean id="getUserAction" class="com.anllin.usermgr.action.GetUserAction">
<property name="userService" ref="userService"></property>
</bean> <bean id="updateUserAction" class="com.anllin.usermgr.action.UpdateUserAction">
<property name="userService" ref="userService"></property>
</bean>
</beans>

  

struts.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <package name="registration" namespace="/" extends="struts-default">
<action name="listUser" class="listUsersAction">
<result name="success">/listUsers.jsp</result>
</action> <action name="addUser" class="addUserAction">
<result name="success" type="redirect">listUser.action</result>
</action> <action name="deleteUser" class="deleteUserAction">
<result name="success" type="redirect">listUser.action</result>
</action> <action name="getUser" class="getUserAction">
<result name="success">updateUser.jsp</result>
</action> <action name="updateUser" class="updateUserAction">
<result name="success" type="redirect">listUser.action</result>
</action>
</package> </struts>

  

jdbc.properties

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

  

log4j.properties

#
# Hibernate, Relational Persistence for Idiomatic Java
#
# Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
# indicated by the @author tags or express copyright attribution
# statements applied by the authors. All third-party contributions are
# distributed under license by Red Hat Middleware LLC.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# Lesser General Public License, as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
# for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this distribution; if not, write to:
# Free Software Foundation, Inc.
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301 USA
# #log4j.rootLogger=info, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.rootLogger=warn, stdout #log4j.logger.org.hibernate=debug
#log4j.logger.org.hibernate.test=info
### log schema export/update ###
log4j.logger.org.hibernate.tool.hbm2ddl=debug
#log4j.logger.org.hibernate.sql.ordering.antlr.OrderByFragmentTranslator=trace
#log4j.logger.org.hibernate.ejb=debug
#log4j.logger.org.hibernate.ejb.packaging=debug
#log4j.logger.org.hibernate.reflection=debug #log4j.logger.org.hibernate.hql.ast.QueryTranslatorImpl=trace
#log4j.logger.org.hibernate.hql.ast.HqlSqlWalker=trace
#log4j.logger.org.hibernate.hql.ast.SqlGenerator=trace
#log4j.logger.org.hibernate.hql.ast.AST=trace
#log4j.logger.org.hibernate.type.descriptor.sql.BasicBinder=trace
#log4j.logger.org.hibernate.type.BasicTypeRegistry=trace #log4j.logger.org.hibernate.engine.Cascades=debug
#log4j.logger.org.hibernate.hql=debug ### log just the SQL
#log4j.logger.org.hibernate.SQL=debug ### log JDBC bind parameters ###
#log4j.logger.org.hibernate.type=info
#log4j.logger.org.hibernate.type=trace ### log HQL parse trees
#log4j.logger.org.hibernate.hql=debug ### log cache activity ###
#log4j.logger.org.hibernate.cache=debug ### log JDBC resource acquisition
#log4j.logger.org.hibernate.jdbc=debug ### enable the following line if you want to track down connection ###
### leakages when using DriverManagerConnectionProvider ###
#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace #log4j.logger.org.jgroups=info
#log4j.logger.org.jboss.cache=trace
#log4j.logger.org.jboss.cache.RegionManager=info
#log4j.logger.org.jboss.cache.lock=info
#log4j.logger.org.jboss.cache.interceptors.PessimisticLockInterceptor=info
#log4j.logger.org.jboss.cache.interceptors.UnlockInterceptor=info

  

AddUserAction.java

package com.anllin.usermgr.action;

import com.anllin.usermgr.model.User;
import com.anllin.usermgr.service.UserService;
import com.opensymphony.xwork2.ActionSupport; public class AddUserAction extends ActionSupport
{
private User user;
private UserService userService; public User getUser()
{
return user;
} public void setUser(User user)
{
this.user = user;
} public UserService getUserService()
{
return userService;
} public void setUserService(UserService userService)
{
this.userService = userService;
} @Override
public String execute() throws Exception
{
if(user != null)
{
this.userService.add(user);
}
return SUCCESS;
}
}

  

DeleteUserAction.java

package com.anllin.usermgr.action;

import org.apache.struts2.ServletActionContext;

import com.anllin.usermgr.service.UserService;
import com.opensymphony.xwork2.ActionSupport; public class DeleteUserAction extends ActionSupport
{
private int id; private UserService userService; public UserService getUserService()
{
return userService;
} public void setUserService(UserService userService)
{
this.userService = userService;
} @Override
public String execute() throws Exception
{
id = Integer.parseInt(ServletActionContext.getRequest().getParameter("id").trim());
if (id > 0)
{
userService.deleteById(id);
}
return SUCCESS;
}
}

  

GetUserAction.java

package com.anllin.usermgr.action;

import org.apache.struts2.ServletActionContext;

import com.anllin.usermgr.model.User;
import com.anllin.usermgr.service.UserService;
import com.opensymphony.xwork2.ActionSupport; public class GetUserAction extends ActionSupport
{
private User user;
private UserService userService;
public User getUser()
{
return user;
}
public void setUser(User user)
{
this.user = user;
}
public UserService getUserService()
{
return userService;
}
public void setUserService(UserService userService)
{
this.userService = userService;
} @Override
public String execute() throws Exception
{
int id = Integer.valueOf(ServletActionContext.getRequest().getParameter("id").trim());
if(id >= 0)
{
this.user = userService.getById(id);
} ServletActionContext.getRequest().setAttribute("user",user); return SUCCESS;
}
}

  

ListUserAction.java

package com.anllin.usermgr.action;

import java.util.List;

import org.apache.struts2.ServletActionContext;

import com.anllin.usermgr.model.User;
import com.anllin.usermgr.service.UserService;
import com.opensymphony.xwork2.ActionSupport; public class ListUserAction extends ActionSupport
{
private List<User> users;
private UserService userService; public List<User> getUsers()
{
return users;
} public void setUsers(List<User> users)
{
this.users = users;
} public UserService getUserService()
{
return userService;
} public void setUserService(UserService userService)
{
this.userService = userService;
} @Override
public String execute() throws Exception
{
users = userService.getAll();
ServletActionContext.getContext().getSession().put("users",users);
return SUCCESS;
}
}

  

UpdateUserAction.java

package com.anllin.usermgr.action;

import com.anllin.usermgr.model.User;
import com.anllin.usermgr.service.UserService;
import com.opensymphony.xwork2.ActionSupport; public class UpdateUserAction extends ActionSupport
{
private User user;
private UserService userService;
public User getUser()
{
return user;
}
public void setUser(User user)
{
this.user = user;
}
public UserService getUserService()
{
return userService;
}
public void setUserService(UserService userService)
{
this.userService = userService;
} @Override
public String execute() throws Exception
{
if(user != null)
{
userService.update(user);
}
return super.execute();
}
}

  

UserDao.java

package com.anllin.usermgr.dao;

import java.util.List;

import com.anllin.usermgr.model.User;

public interface UserDao
{
void add(User user);
void update(User user);
void delete(User user);
void deleteById(int id);
User getById(int id);
List<User> getByName(String username);
List<User> getAll();
}

  

UserDaoImpl.java

package com.anllin.usermgr.dao.impl;

import java.util.List;

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

import com.anllin.usermgr.dao.UserDao;
import com.anllin.usermgr.model.User; public class UserDaoImpl extends HibernateDaoSupport implements UserDao
{
@Override
public void add(User user)
{
this.getHibernateTemplate().save(user);
} @Override
public void delete(User user)
{
this.getHibernateTemplate().delete(user);
} @Override
public void deleteById(int id)
{
User user = (User)this.getHibernateTemplate().get(User.class,id);
delete(user);
} @SuppressWarnings("unchecked")
@Override
public List<User> getAll()
{
return (List<User>)this.getHibernateTemplate().find("from User");
} @Override
public User getById(int id)
{
return (User)this.getHibernateTemplate().get(User.class,id);
} @SuppressWarnings("unchecked")
@Override
public List<User> getByName(String username)
{
List<User> users = (List<User>)this.getHibernateTemplate().find("from User as u where u.username=?",username); return users;
} @Override
public void update(User user)
{
this.getHibernateTemplate().update(user);
} }

  

User.java

package com.anllin.usermgr.model;

import java.sql.Date;

public class User
{
private int id;
private String username;
private String password;
private int age;
private Date birthday; public int getId()
{
return id;
} public void setId(int id)
{
this.id = id;
} public String getUsername()
{
return username;
} public void setUsername(String username)
{
this.username = username;
} public String getPassword()
{
return password;
} public void setPassword(String password)
{
this.password = password;
} public int getAge()
{
return age;
} public void setAge(int age)
{
this.age = age;
} public Date getBirthday()
{
return birthday;
} public void setBirthday(Date birthday)
{
this.birthday = birthday;
} }

  

User.hbm.xml

<?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>
<class name="com.anllin.usermgr.model.User" dynamic-update="true" dynamic-insert="true">
<id name="id" column="id" type="integer">
<generator class="native"/>
</id>
<property name="username" type="string">
<column name="username" length="20"/>
</property>
<property name="password" type="string">
<column name="password" length="20"/>
</property>
<property name="age" type="integer">
<column name="age"/>
</property>
<property name="birthday" type="date">
<column name="birthday"/>
</property>
</class>
</hibernate-mapping>

  

UserService.java

package com.anllin.usermgr.service;

import java.util.List;

import com.anllin.usermgr.model.User;

public interface UserService
{
void add(User user);
void update(User user);
void delete(User user);
void deleteById(int id);
User getById(int id);
List<User> getByName(String username);
List<User> getAll();
boolean isExistsUser(String username);
}

  

UserServiceImpl.java

package com.anllin.usermgr.service.impl;

import java.util.List;

import com.anllin.usermgr.dao.UserDao;
import com.anllin.usermgr.model.User;
import com.anllin.usermgr.service.UserService; public class UserServiceImpl implements UserService
{
private UserDao userDao; public UserDao getUserDao()
{
return userDao;
} public void setUserDao(UserDao userDao)
{
this.userDao = userDao;
} @Override
public void add(User user)
{
this.userDao.add(user);
} @Override
public void delete(User user)
{
this.userDao.delete(user);
} @Override
public void deleteById(int id)
{
this.userDao.deleteById(id);
} @Override
public List<User> getAll()
{
return this.userDao.getAll();
} @Override
public User getById(int id)
{
return this.userDao.getById(id);
} @Override
public List<User> getByName(String username)
{
return this.userDao.getByName(username);
} @Override
public boolean isExistsUser(String username)
{
List<User> users = getByName(username);
if(users != null && users.size() > 0)
{
return true;
}
return false;
} @Override
public void update(User user)
{
this.userDao.update(user);
} }

  

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">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list> <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> <context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:beans.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener> </web-app>

  

addUser.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>Add User</title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<style type="text/css">
h1
{
color:blue;
}
</style>"
</head> <body>
<h1>Add User</h1>
<s:form action="addUser.action" theme="simple">
username: <s:textfield name="user.username"/><br/>
password: <s:password name="user.password"/><br/>
age: <s:textfield name="user.age"/><br/>
birthday: <s:textfield name="user.birthday"/><br/>
<s:submit value="submit"/>
</s:form>
</body>
</html>

  

index.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"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>"> <title>User Manager</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache"> <style type="text/css">
body
{
font-family:Courial new,sans-serif;
font-size: 16px;
}
div
{
margin:0 auto;
text-align: center;
background: window;
}
div h1
{
color:Blue;
}
div a:link
{
color:blue;
}
div a:hover
{
color:red;
font-size:18px;
font-weight: bold;
font-style: italic;
} </style>
</head> <body>
<div>
<h1>User Manager</h1><br/><br/><br/>
<s:a href="listUser.action">Show All Users</s:a><br/><br/><br/>
<s:a href="addUser.jsp">Add a New User</s:a><br/>
</div>
</body>
</html>

  

listUsers.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>List All Users</title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<style type="text/css">
table
{
border-collapse: collapse;
}
table tr th
{
background: MediumSlateBlue;
color: white;
}
table tr td
{
border:1px solid black;
background: AliceBlue;
}
h1
{
color:blue;
}
</style>
</head> <body>
<h1 align="center">List All Users</h1>
<table align="center" width="80%">
<tr>
<th>username</th>
<th>password</th>
<th>age</th>
<th>birthday</th>
<th>update</th>
<th>delete</th>
</tr>
<s:iterator value="%{#session.users}">
<tr>
<td>
<s:property value="username"/>
</td>
<td>
<s:property value="password"/>
</td>
<td>
<s:property value="age"/>
</td>
<td>
<s:property value="birthday"/>
</td>
<td>
<s:a href="getUser.action?id=%{#this.id}">update</s:a>
</td>
<td>
<s:a href="deleteUser.action?id=%{#this.id}">delete</s:a>
</td>
</tr>
</s:iterator>
</table>
</body>
</html>

  

updateUser.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>Update User</title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache"> <STYLE type="text/css">
h1
{
color: blue;
}
</STYLE>
</head> <body>
<h1>Update User</h1>
<s:form action="updateUser.action" theme="simple">
<s:hidden name="user.id" value="%{#request.user.id}"></s:hidden>
username: <s:textfield name="user.username" value="%{#request.user.username}"/><br/>
password: <s:textfield name="user.password" value="%{#request.user.password}"/><br/>
age: <s:textfield name="user.age" value="%{#request.user.age}"/><br/>
birthday: <s:textfield name="user.birthday" value="%{#request.user.birthday}"/><br/>
<s:submit value="sumbit changed"></s:submit>
</s:form>
<s:debug></s:debug>
</body>
</html>

SSH使用总结(xml配置)的更多相关文章

  1. SSH框架,xml配置实现动态定时器

    <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-// ...

  2. SSH项目web.xml文件的常用配置【struts2的过滤器、spring监听器、解决Hibernate延迟加载问题的过滤器、解决中文乱码的过滤器】

    配置web.xml(struts2的过滤器.spring监听器.解决Hibernate延迟加载问题的过滤器.解决中文乱码的过滤器) <!-- 解决中文乱码问题 --> <filter ...

  3. java web.xml配置详解(转)

    源出处:java web.xml配置详解 1.常规配置:每一个站的WEB-INF下都有一个web.xml的设定文件,它提供了我们站台的配置设定. web.xml定义: .站台的名称和说明 .针对环境参 ...

  4. 转:web.xml 配置中classpath: 与classpath*:的区别

    原文链接:web.xml 配置中classpath: 与classpath*:的区别 引用自:http://blog.csdn.net/wxwzy738/article/details/1698393 ...

  5. Spring 入门 web.xml配置详解

    Spring 入门 web.xml配置详解 https://www.cnblogs.com/cczz_11/p/4363314.html https://blog.csdn.net/hellolove ...

  6. Maven settings.xml配置详解

    首先:Maven中央仓库的搜索全部公共jar包的地址是,http://search.maven.org/ ===Maven基础-默认中央仓库============================== ...

  7. Mybatis XML配置

    Mybatis常用带有禁用缓存的XML配置 <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE ...

  8. SpringMvc的xml配置与annotation配置的例子的区别

    1.导入jar包时,要在xml配置基础上加 spring-aop-4.2.2.RELEASE.jar (注解的时候需要) 2.编写controller的时候要annotation需要做相关配置即红色部 ...

  9. Hibernate实现有两种配置,xml配置与注释配置

    hibernate实现有两种配置,xml配置与注释配置. (1):xml配置:hibernate.cfg.xml (放到src目录下)和实体配置类:xxx.hbm.xml(与实体为同一目录中) < ...

随机推荐

  1. python——动态类型简介

    动态类型简介 类型属于对象,而不是变量 每一个对象都有两个标准的头部信息:类型标志符和引用计数器. 对象的垃圾收集,就是通过引用计数器实现的.可以在脚本中任意使用对象而不需要考虑释放内存空间. 循环饮 ...

  2. php编写的抽奖程序中奖概率算法

    本文给大家分享的是php中奖概率算法,可用于刮刮卡,大转盘等抽奖算法.用法很简单,代码里有详细注释说明,一看就懂,有需要的小伙伴参考下吧. 我们先完成后台PHP的流程,PHP的主要工作是负责配置奖项及 ...

  3. PHP练习题一

    目录:1.如何使用php导入导出csv?2.php接收POST数据的方式有哪些?3.如何让json_encode()不转义斜杠?我在做服务器返回一些数据时需要返回一些地址,但是默认的json_code ...

  4. asp.net Core 部署到CentOs7上,使用Nginx做代理

    一.CentOs7部署Nginx 1.准备工作 Nginx的安装依赖于以下三个包,意思就是在安装Nginx之前首先必须安装一下的三个包,注意安装顺序如下: 1 SSL功能需要openssl库,直接通过 ...

  5. android studio 更新Gradle版本方法

    在导入其他项目时,经常由于gradle版本不一致而导致不能编译 解决方法: 第一步: 按提示点击让它下载,其实目的并不是要它下载,因为这样速度会很慢,这样做只是为了让它在本地创建相应的目录结构 第二步 ...

  6. perl非root用户安装模块

    install perl Module 1. search module's package on [Google](https://www.google.com) or [CPAN Search S ...

  7. Maven添加Oracle驱动及依赖

    oracle驱动先去官网下载,下载下来后,需要安装到maven本地仓库,然后再pom中添加依赖. 1下载oracle驱动包 ojdbc6-11.2.0.3.jar 2命令行安装到maven仓库 mvn ...

  8. 在mybatis中使用存储过程报错java.sql.SQLException: ORA-06550: 第 1 行, 第 7 列: PLS-00905: 对象 USER1.HELLO_TEST 无效 ORA-06550: 第 1 行, 第 7 列:

    hello_test是我的存储过程的名字,在mapper.xml文件中是这么写的 <select id="getPageByProcedure" statementType= ...

  9. Angular 2 Architecture Overview

    Module 简单来说模块(module)就是完成共同目的的代码块,export一些内容例如一个类.函数.或值变量. component就是一个基本的Angular块,一个component类其实也是 ...

  10. 一台电脑上同时使用两个github账户

    需求:公司有github账号,自己有github账号,想在Git上同时使用,两者互不干扰. 思路:管理两个SHH key. 解决办法: 一.生成两个SSH key 为了举例方便,这里使用“one”和“ ...