parent
1942cd395a
commit
d6b06dfd04
@ -1,21 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" path="src/main/java"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" path="src/main/java"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
|
@ -1,42 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>yhSearch</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
|
||||
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>yhSearch</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
|
||||
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src/main/webapp"/>
|
||||
<classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
|
||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
|
||||
<attributes>
|
||||
<attribute name="hide" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
|
||||
<classpathentry kind="output" path=""/>
|
||||
</classpath>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src/main/webapp"/>
|
||||
<classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
|
||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
|
||||
<attributes>
|
||||
<attribute name="hide" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
|
||||
<classpathentry kind="output" path=""/>
|
||||
</classpath>
|
||||
|
@ -1,8 +1,8 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
||||
|
@ -1,4 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
<wb-module deploy-name="yhSearch">
|
||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
<property name="context-root" value="yhSearch"/>
|
||||
<property name="java-output-path" value="/yhSearch/target/classes"/>
|
||||
</wb-module>
|
||||
</project-modules>
|
||||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
<wb-module deploy-name="yhSearch">
|
||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
<property name="context-root" value="yhSearch"/>
|
||||
<property name="java-output-path" value="/yhSearch/target/classes"/>
|
||||
</wb-module>
|
||||
</project-modules>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<fixed facet="wst.jsdt.web"/>
|
||||
<installed facet="java" version="1.5"/>
|
||||
<installed facet="jst.web" version="2.3"/>
|
||||
<installed facet="wst.jsdt.web" version="1.0"/>
|
||||
</faceted-project>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<fixed facet="wst.jsdt.web"/>
|
||||
<installed facet="java" version="1.5"/>
|
||||
<installed facet="jst.web" version="2.3"/>
|
||||
<installed facet="wst.jsdt.web" version="1.0"/>
|
||||
</faceted-project>
|
||||
|
@ -1,2 +1,2 @@
|
||||
disabled=06target
|
||||
eclipse.preferences.version=1
|
||||
disabled=06target
|
||||
eclipse.preferences.version=1
|
||||
|
@ -1,32 +1,51 @@
|
||||
package controller;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import domain.yhPO;
|
||||
import service.yhService;
|
||||
@Controller
|
||||
public class yhController {
|
||||
@Autowired@Qualifier("yhServiceImpl")
|
||||
private yhService yhService;
|
||||
|
||||
@RequestMapping("/search")
|
||||
public String search(Model model,String s_id){
|
||||
yhPO yhPO=yhService.search(s_id);
|
||||
model.addAttribute("s_id", yhPO.getS_id());
|
||||
model.addAttribute("s_name", yhPO.getS_name());
|
||||
model.addAttribute("s_password", yhPO.getS_password());
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping("/update")
|
||||
public String update(yhPO yhPO){
|
||||
yhService.update(yhPO);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
package controller;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Writer;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import domain.yhPO;
|
||||
import service.yhService;
|
||||
@Controller
|
||||
public class yhController {
|
||||
@Autowired@Qualifier("yhServiceImpl")
|
||||
private yhService yhService;
|
||||
@RequestMapping("find2")
|
||||
public void find1(String search,HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||
response.setContentType("text/html;charset=utf-8");
|
||||
/* 设置响应头允许ajax跨域访问 */
|
||||
response.setHeader("Access-Control-Allow-Origin", "*");
|
||||
/* 星号表示所有的异域请求都可以接受, */
|
||||
response.setHeader("Access-Control-Allow-Methods", "GET,POST");
|
||||
yhPO yhPO=this.yhService.FindBysname(search);
|
||||
if(yhPO!=null) {
|
||||
String ss = new Gson().toJson(yhPO);
|
||||
System.out.println(ss);
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
out.print(ss);
|
||||
out.flush();
|
||||
out.close();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
System.out.println("查询失败");
|
||||
Writer out = response.getWriter();
|
||||
out.write("zhaobudao");
|
||||
out.flush();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,35 +1,35 @@
|
||||
package domain;
|
||||
import java.io.Serializable;
|
||||
public class yhPO implements Serializable {
|
||||
private String s_id;
|
||||
private String s_name;
|
||||
private String s_password;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public String getS_id() {
|
||||
return s_id;
|
||||
}
|
||||
|
||||
public void setS_id(String s_id) {
|
||||
this.s_id = s_id;
|
||||
}
|
||||
|
||||
public String getS_name() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public void setS_name(String s_name) {
|
||||
this.s_name = s_name;
|
||||
}
|
||||
|
||||
public String getS_password() {
|
||||
return s_password;
|
||||
}
|
||||
|
||||
public void setS_password(String s_password) {
|
||||
this.s_password = s_password;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
package domain;
|
||||
import java.io.Serializable;
|
||||
public class yhPO implements Serializable {
|
||||
private String s_id;
|
||||
private String s_name;
|
||||
private String s_password;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public String getS_id() {
|
||||
return s_id;
|
||||
}
|
||||
|
||||
public void setS_id(String s_id) {
|
||||
this.s_id = s_id;
|
||||
}
|
||||
|
||||
public String getS_name() {
|
||||
return s_name;
|
||||
}
|
||||
|
||||
public void setS_name(String s_name) {
|
||||
this.s_name = s_name;
|
||||
}
|
||||
|
||||
public String getS_password() {
|
||||
return s_password;
|
||||
}
|
||||
|
||||
public void setS_password(String s_password) {
|
||||
this.s_password = s_password;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,16 +1,16 @@
|
||||
package mapperDAO;
|
||||
|
||||
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import domain.yhPO;
|
||||
@Repository("yhMapperDao")
|
||||
public interface yhMapperDao {
|
||||
|
||||
public yhPO search(String s_id);
|
||||
|
||||
|
||||
public void update(yhPO yhPO);
|
||||
|
||||
}
|
||||
package mapperDAO;
|
||||
|
||||
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import domain.yhPO;
|
||||
@Repository("yhMapperDao")
|
||||
public interface yhMapperDao {
|
||||
|
||||
public yhPO FindBysname(String search );
|
||||
|
||||
|
||||
public void update(yhPO yhPO);
|
||||
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
package service;
|
||||
|
||||
import domain.yhPO;
|
||||
|
||||
|
||||
|
||||
public interface yhService {
|
||||
|
||||
public yhPO search(String bs_id);
|
||||
|
||||
public void update(yhPO yhpo);
|
||||
|
||||
}
|
||||
package service;
|
||||
|
||||
import domain.yhPO;
|
||||
|
||||
|
||||
|
||||
public interface yhService {
|
||||
|
||||
public yhPO FindBysname(String search );
|
||||
|
||||
public void update(yhPO yhpo);
|
||||
|
||||
}
|
||||
|
@ -1,32 +1,30 @@
|
||||
package serviceimpl;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import domain.yhPO;
|
||||
import mapperDAO.yhMapperDao;
|
||||
import service.yhService;
|
||||
|
||||
@Component("yhServiceImpl")
|
||||
public class yhServiceImpl implements yhService{
|
||||
@Autowired@Qualifier("yhMapperDao")
|
||||
private yhMapperDao yhMapperDao;
|
||||
|
||||
public yhPO search(String s_id) {
|
||||
return this.yhMapperDao.search(s_id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void update(yhPO yhpo) {
|
||||
// TODO Auto-generated method stub
|
||||
yhMapperDao.update(yhpo);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
package serviceimpl;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import domain.yhPO;
|
||||
import service.yhService;
|
||||
import mapperDAO.yhMapperDao;
|
||||
@Component("yhServiceImpl")
|
||||
public class yhServiceImpl implements yhService{
|
||||
@Autowired@Qualifier("yhMapperDao")
|
||||
private yhMapperDao yhMapperDAO;
|
||||
|
||||
public yhPO FindBysname(String search) {
|
||||
// TODO Auto-generated method stub
|
||||
return this.yhMapperDAO.FindBysname(search);
|
||||
}
|
||||
|
||||
public void update(yhPO yhpo) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,26 +1,26 @@
|
||||
<?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="mapperDAO.yhMapperDao">
|
||||
<resultMap id="yhMap" type="domain.yhPO">
|
||||
<id column="s_id" jdbcType="int" property="s_id" />
|
||||
<result column="s_password" jdbcType="VARCHAR" property="s_password" />
|
||||
<result column="s_name" jdbcType="VARCHAR" property="s_name" />
|
||||
</resultMap>
|
||||
<select id="search" resultMap="yhMap" parameterType="String">
|
||||
SELECT
|
||||
student.s_id,
|
||||
student.s_name,
|
||||
student.s_password,
|
||||
FROM
|
||||
student
|
||||
WHERE
|
||||
student.s_id=#{s_id}
|
||||
</select>
|
||||
|
||||
<select id="update" parameterType="domain.yhPO">
|
||||
UPDATE yh.student
|
||||
SET s_id=#{s_id},s_password=#{s_password},s_name=#{s_name}
|
||||
WHERE student.s_id=#{s_id};
|
||||
|
||||
</select>
|
||||
<?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="mapperDAO.yhMapperDao">
|
||||
<resultMap id="yhMap" type="domain.yhPO">
|
||||
<id column="s_id" jdbcType="int" property="s_id" />
|
||||
<result column="s_password" jdbcType="VARCHAR" property="s_password" />
|
||||
<result column="s_name" jdbcType="VARCHAR" property="s_name" />
|
||||
</resultMap>
|
||||
<select id="FindBysname" resultMap="yhMap" parameterType="String">
|
||||
SELECT
|
||||
student.s_id,
|
||||
student.s_name,
|
||||
student.s_password,
|
||||
FROM
|
||||
student
|
||||
WHERE
|
||||
student.s_id=#{search}
|
||||
</select>
|
||||
|
||||
<select id="update" parameterType="domain.yhPO">
|
||||
UPDATE yh.student
|
||||
SET s_id=#{s_id},s_password=#{s_password},s_name=#{s_name}
|
||||
WHERE student.s_id=#{s_id};
|
||||
|
||||
</select>
|
||||
</mapper>
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-config.dtd">
|
||||
<configuration>
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-config.dtd">
|
||||
<configuration>
|
||||
</configuration>
|
@ -1,11 +1,11 @@
|
||||
<?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"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">
|
||||
<!-- 打开Spring的注解 -->
|
||||
<context:annotation-config />
|
||||
|
||||
<context:component-scan base-package="mapperDAO,controller,serviceimpl"/>
|
||||
<?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"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">
|
||||
<!-- 打开Spring的注解 -->
|
||||
<context:annotation-config />
|
||||
|
||||
<context:component-scan base-package="mapperDAO,controller,serviceimpl"/>
|
||||
</beans>
|
@ -1,7 +1,20 @@
|
||||
<!DOCTYPE web-app PUBLIC
|
||||
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
|
||||
"http://java.sun.com/dtd/web-app_2_3.dtd" >
|
||||
|
||||
<web-app>
|
||||
<display-name>Archetype Created Web Application</display-name>
|
||||
</web-app>
|
||||
<display-name>Archetype Created Web Application</display-name>
|
||||
<!-- Processes application requests -->
|
||||
<servlet>
|
||||
<servlet-name>appServlet</servlet-name>
|
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>classpath:spring-*.xml</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>appServlet</servlet-name>
|
||||
<url-pattern>/</url-pattern>
|
||||
</servlet-mapping>
|
||||
</web-app>
|
Binary file not shown.
@ -1,26 +1,26 @@
|
||||
<?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="mapperDAO.yhMapperDao">
|
||||
<resultMap id="yhMap" type="domain.yhPO">
|
||||
<id column="s_id" jdbcType="int" property="s_id" />
|
||||
<result column="s_password" jdbcType="VARCHAR" property="s_password" />
|
||||
<result column="s_name" jdbcType="VARCHAR" property="s_name" />
|
||||
</resultMap>
|
||||
<select id="search" resultMap="yhMap" parameterType="String">
|
||||
SELECT
|
||||
student.s_id,
|
||||
student.s_name,
|
||||
student.s_password,
|
||||
FROM
|
||||
student
|
||||
WHERE
|
||||
student.s_id=#{s_id}
|
||||
</select>
|
||||
|
||||
<select id="update" parameterType="domain.yhPO">
|
||||
UPDATE yh.student
|
||||
SET s_id=#{s_id},s_password=#{s_password},s_name=#{s_name}
|
||||
WHERE student.s_id=#{s_id};
|
||||
|
||||
</select>
|
||||
<?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="mapperDAO.yhMapperDao">
|
||||
<resultMap id="yhMap" type="domain.yhPO">
|
||||
<id column="s_id" jdbcType="int" property="s_id" />
|
||||
<result column="s_password" jdbcType="VARCHAR" property="s_password" />
|
||||
<result column="s_name" jdbcType="VARCHAR" property="s_name" />
|
||||
</resultMap>
|
||||
<select id="FindBysname" resultMap="yhMap" parameterType="String">
|
||||
SELECT
|
||||
student.s_id,
|
||||
student.s_name,
|
||||
student.s_password,
|
||||
FROM
|
||||
student
|
||||
WHERE
|
||||
student.s_id=#{search}
|
||||
</select>
|
||||
|
||||
<select id="update" parameterType="domain.yhPO">
|
||||
UPDATE yh.student
|
||||
SET s_id=#{s_id},s_password=#{s_password},s_name=#{s_name}
|
||||
WHERE student.s_id=#{s_id};
|
||||
|
||||
</select>
|
||||
</mapper>
|
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-config.dtd">
|
||||
<configuration>
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-config.dtd">
|
||||
<configuration>
|
||||
</configuration>
|
Binary file not shown.
Binary file not shown.
@ -1,11 +1,11 @@
|
||||
<?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"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">
|
||||
<!-- 打开Spring的注解 -->
|
||||
<context:annotation-config />
|
||||
|
||||
<context:component-scan base-package="mapperDAO,controller,serviceimpl"/>
|
||||
<?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"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">
|
||||
<!-- 打开Spring的注解 -->
|
||||
<context:annotation-config />
|
||||
|
||||
<context:component-scan base-package="mapperDAO,controller,serviceimpl"/>
|
||||
</beans>
|
@ -1,5 +1,5 @@
|
||||
Manifest-Version: 1.0
|
||||
Built-By: yuanhangpc
|
||||
Build-Jdk: 1.8.0_152
|
||||
Created-By: Maven Integration for Eclipse
|
||||
|
||||
Manifest-Version: 1.0
|
||||
Built-By: yuanhangpc
|
||||
Build-Jdk: 1.8.0_152
|
||||
Created-By: Maven Integration for Eclipse
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#Generated by Maven Integration for Eclipse
|
||||
#Sat Jan 12 16:17:25 CST 2019
|
||||
version=0.0.1-SNAPSHOT
|
||||
groupId=yonghu
|
||||
m2e.projectName=yhSearch
|
||||
m2e.projectLocation=H\:\\sts-bundle\\yhSearch
|
||||
artifactId=yhSearch
|
||||
#Generated by Maven Integration for Eclipse
|
||||
#Mon Jan 14 16:52:07 CST 2019
|
||||
version=0.0.1-SNAPSHOT
|
||||
groupId=yonghu
|
||||
m2e.projectName=yhSearch
|
||||
m2e.projectLocation=H\:\\sts-bundle\\yhSearch
|
||||
artifactId=yhSearch
|
||||
|
Loading…
Reference in new issue