我是靠谱客的博主 瘦瘦花生,最近开发中收集的这篇文章主要介绍SSH spring+springmvc+hibernate+maven 整合详解,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

1、SSH框架介绍

1.1、Spring

Spring是一个开源框架,Spring是于2003 年兴起的一个轻量级的Java 开发框架,Spring使用基本的JavaBean来完成以前只可能由EJB完成的事情。 简单来说,Spring是一个轻量级的控制反转(IoC)和面向切面(AOP)的容器框架。

1.2、SpringMVC

Spring MVC属于SpringFrameWork的后续产品,已经融合在Spring Web Flow里面。Spring MVC 分离了控制器、模型对象、分派器以及处理程序对象的角色,这种分离让它们更容易进行定制。

1.3、Hibernate

作为SSH三大框架之一的Hibernate,是用来把程序的Dao层和数据库打交道用的,它封装了JDBC的步骤,是我们对数据库的操作更加简单,更加快捷。利用Hibernate框架我们就可以不再编写重复的JDBC代码,不再反复的测试我们的SQL语句写的如何

2、项目环境

本项目的开发基于maven3.4.0,jetty6.1.26,mysql,eclipse,JDK7等

3、SSH整合步骤(超详细)
首先新建一个maven项目,选择maven-archetype-webapp,一直下一步就好了
本项目功能:模拟新增人员、编辑人员信息、删除人员信息
项目目录如下:
这里写图片描述
3.1 配置pom.xml

<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.iflytek</groupId>
<artifactId>ssh</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>ssh Maven Webapp</name>
<url>http://maven.apache.org</url>
<properties>
<spring.version>4.1.3.RELEASE</spring.version>
<commons-lang.version>2.6</commons-lang.version>
<slf4j.version>1.7.6</slf4j.version>
<servlet.version>2.5</servlet.version>
</properties>
<!-- 管理所有spring相关jar包的版本号 -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>${spring.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<!-- <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId>
</dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId>
</dependency> -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.7</version>
</dependency>
<!-- <dependency> <groupId>c3p0</groupId> <artifactId>c3p0</artifactId>
<version>0.9.2</version> </dependency> -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>3.2.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.2.2.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.0.Final</version>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jandex</artifactId>
<version>2.0.0.Final</version>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.12.1.GA</version>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>3.1.0.GA</version>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.transaction</groupId>
<artifactId>jboss-transaction-api_1.1_spec</artifactId>
<version>1.0.0.Final</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
</dependency>
<!-- <dependency> <groupId>jstl</groupId> <artifactId>jstl</artifactId>
<version>1.0</version> </dependency> -->
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.34</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.0</version>
</dependency>
<!-- servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>${servlet.version}</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>${commons-lang.version}</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>ejb3-persistence</artifactId>
<version>1.0.1.GA</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<!-- <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId>
<version>9.2.2.v20160723</version> -->
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
<configuration>
<webAppConfig>
<contextPath>/</contextPath>
</webAppConfig>
</configuration>
</plugin>
</plugins>
<finalName>ssh</finalName>
</build>
</project>

3.2 配置web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>SpringMVC+spring+hibernate</display-name>
<!-- 防止中文参数乱码 放在前面 -->
<filter>
<filter-name>SetCharacterEncoding</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
<!-- 强制进行转码 -->
</init-param>
</filter>
<filter-mapping>
<filter-name>SetCharacterEncoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- spring 配置Listener-->
<!-- needed for ContextLoaderListener -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/configs/spring/applicationContext*.xml</param-value>
</context-param>
<!-- Bootstraps the root web application context before servlet initialization -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- springmvc配置dispatcherServlet -->
<!-- 入口是前端控制器 -->
<servlet>
<servlet-name>springDispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/configs/spring/springmvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Map all requests to the DispatcherServlet for handling -->
<servlet-mapping>
<servlet-name>springDispatcherServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>

3.3 配置 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:tx="http://www.springframework.org/schema/tx"
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.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd ">
<context:component-scan base-package="com.iflytek.ssh">
<context:exclude-filter type="annotation"
expression="org.springframework.stereotype.Controller" />
</context:component-scan>
<!-- 引入外部的属性文件 -->
<!-- <context:property-placeholder location="/jdbc.properties"/> -->
<!-- 配置jdbc连接池 -->
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url"
value="jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf8" />
<property name="username" value="root" />
<property name="password" value="123456" />
</bean>
<!-- 配置hibernate 相关属性 -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<!-- 注入连接池 -->
<property name="dataSource" ref="dataSource"></property>
<!-- hibernate 的相关属性 -->
<property name="hibernateProperties">
<props>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.format_sql">true </prop>
<!-- 它包含4个属性: * create : 会根据你的model类来生成表,但是每次运行都会删除上一次的表,重新生成表,哪怕2次没有任何改变
* create-drop : 根据model类生成表,但是sessionFactory一关闭,表就自动删除 * update : 最常用的属性,也根据model类生成表,即使表结构改变了,表中的行仍然存在,不会删除以前的行
* validate : 只会和数据库中的表进行比较,不会创建新表,但是会插入新值 -->
<prop key="hibernate.hbm2ddl.auto">update</prop>
</props>
</property>
<!-- hibernate 映射文件扫描 -->
<property name="packagesToScan">
<list>
<value>com.iflytek.ssh.entity</value>
</list>
</property>
</bean>
<!-- 配置事务管理器 -->
<bean id="transactionManager"
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<!-- 开启事务注解 -->
<!-- transaction-manager:指定事务管理器名字,默认为transactionManager,当使用其他名字时需要明确指定 -->
<tx:annotation-driven transaction-manager="transactionManager" />
</beans>

3.4 配置springmvc.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:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- 配置自动扫描的包,组件扫描 -->
<context:component-scan base-package="com.iflytek.ssh">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service"/>
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Repository"/>
</context:component-scan>
<!-- ,配置视图解析器 如何把 handler 方法返回值解析为实际的物理视图,jsp路径的前缀和后缀 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
<!--
静态资源交给默认的Servlet-->
<mvc:default-servlet-handler/>
<!-- 使用 mvc:annotation-driven代替上边注解映射器和注解适配器配置
mvc:annotation-driven默认加载很多的参数绑定方法,
比如json转换解析器就默认加载了,如果使用mvc:annotation-driven不用配置上边的RequestMappingHandlerMapping和RequestMappingHandlerAdapter
实际开发时使用mvc:annotation-driven
-->
<mvc:annotation-driven/>
</beans>

4.业务代码编写

model层:Person.java

package com.iflytek.ssh.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
@Entity
@Table(name="person")
public class Person {
@Id
@GenericGenerator(name="generator",strategy="uuid")
@GeneratedValue(generator="generator")
@Column(name = "id",nullable=false,length=32)
private String id;
@Column(name="name",length=100)
private String name;
@Column(name = "idCard",length=20)
private String idCard;
@Column(name="phone",length=20)
private String phone;
@Column(name="address",length=100)
private String address;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getIdCard() {
return idCard;
}
public void setIdCard(String idCard) {
this.idCard = idCard;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}

Dao层:编写CRUD操作PersonDao.java

package com.iflytek.ssh.dao;
import java.util.List;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.iflytek.ssh.entity.Person;
/**
* 数据层
* @author yanzhang9
*
*/
@Repository
public class PersonDao {
@Autowired
private SessionFactory sessionFactory;
private Session getSession(){
return sessionFactory.getCurrentSession();
}
/**
* 保存
*/
public void savePerson(Person person){
this.getSession().save(person);
}
/**
* 查看人员信息
* @return
*/
@SuppressWarnings("unchecked")
public List<Person> getPersons(){
return this.getSession().createQuery("from Person ").list();
//
return this.getSession().createCriteria(Person.class).list();
}
/**
* 删除
* @param id
*/
public void deletePersonById(String id){
//
this.getSession().delete("id", id);
this.getSession().createQuery("delete Person where id=?").setParameter(0, id).executeUpdate();
}
/**
* 修改
* @param person
*/
public void updatePerson(Person person){
Person per = (Person)this.getSession().get(Person.class, person.getId());
per.setName(person.getName());
per.setPhone(person.getPhone());
per.setIdCard(person.getIdCard());
per.setAddress(person.getAddress());
this.getSession().save(per);
//
this.getSession().saveOrUpdate(person);
//
this.getSession().update(person);
}
/**
* 查看个人信息
* @param id
* @return
*/
public Person getPersonById(String id){
return (Person)this.getSession().get(Person.class, id);
//
return (Person) this.getSession().createQuery("from Person where id=?").setParameter(0, id).uniqueResult();
}
}

service层:PersonService.java

package com.iflytek.ssh.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.iflytek.ssh.dao.PersonDao;
import com.iflytek.ssh.entity.Person;
@Service("personService")
@Transactional
public class PersonService {
@Autowired
private PersonDao personDao;
/**
* 保存
*/
//
@Transactional
public void savePerson(Person person){
personDao.savePerson(person);
}
/**
* 查看人员信息
* @return
*/
public List<Person> getPersons(){
return personDao.getPersons();
}
/**
* 删除
* @param id
*/
public void deletePersonById(String id){
personDao.deletePersonById(id);
}
/**
* 修改
* @param person
*/
public void updatePerson(Person person){
personDao.updatePerson(person);
}
/**
* 查看个人信息
* @param id
* @return
*/
public Person getPersonById(String id){
return personDao.getPersonById(id);
}
}

controller控制层:PersonController.java

package com.iflytek.ssh.controller;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.iflytek.ssh.entity.Person;
import com.iflytek.ssh.service.PersonService;
@Controller
@RequestMapping("/person")
public class PersonController {
@Autowired
private PersonService personService;
/**
* 跳转的登录页面
* @return
*/
@RequestMapping("/login")
public String login(){
return "index";
}
/**
* 验证登录是否成功
* @param username
* @param password
* @return
*/
@RequestMapping("doLogin")
public String doLogin(String username,String password,HttpSession session){
if(username.equals("admin") && password.equals("admin")){
//用户名存储打session里
session.setAttribute("username", username);
return "frame";
}
return "error";
}
/**
* 保存
*/
@RequestMapping("/savePerson")
public String savePerson(Person person){
personService.savePerson(person);
return "redirect:main";
}
/**
* 跳转到添加页面
* @return
*/
@RequestMapping("/addPerson")
public String savePerson(){
return "savePerson";
}
/**
* 查看所有人员信息
* @return
*/
@RequestMapping("/main")
public String getPersons(Map<String, Object> map){
List<Person> list = personService.getPersons();
map.put("personlist", list);
return "main";
}
/**
* 删除
* @param id
*/
@RequestMapping("/deletePersonById")
public String deletePersonById(String id){
personService.deletePersonById(id);
return "redirect:main";
}
/**
* 修改
* @param person
*/
@RequestMapping("/updatePerson")
public String updatePerson(Person person){
personService.updatePerson(person);
return "redirect:main";
}
/**
* 查看个人信息
* @param id
* @return
*/
@RequestMapping("/doUpdate")
public String getPersonById(String id,Map<String, Object> map){
Person person = personService.getPersonById(id);
map.put("person", person);
return "editPerson";
}
}

5.view层
index.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登录</title>
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/style/reset.css">
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/style/main.css">
</head>
<body>
<div class="headerBar">
<div class="logoBar login_logo">
<div class="comWidth">
<div class="logo fl">
<a href="#"><img src="${pageContext.request.contextPath}/images/logo.jpg"></a>
</div>
<h3 class="welcome_title">欢迎登陆</h3>
</div>
</div>
</div>
<form action="${pageContext.request.contextPath}/person/doLogin" method="post" >
<div class="loginBox">
<div class="login_cont">
<ul class="login">
<li class="l_tit">用户名</li>
<li class="mb_10"><input type="text" name="username" class="login_input user_icon"></li>
<li class="l_tit">密码</li>
<li class="mb_10"><input type="password" name="password" class="login_input user_icon"></li>
<li><input type="submit" value="登录"
class="login_btn"></li>
</ul>
</div>
</div>
</form>
<div class="hr_25"></div>
</body>
</html>

savePerson.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h3>人员添加</h3>
<br />
<br />
<form id="saveForm" action="${pageContext.request.contextPath}/person/savePerson" method="post">
<table style="font-size: :16px">
<tr>
<td>姓名:</td>
<td><input type="text" value="${person.name }" name="name" /></td>
</tr>
<tr>
<td>身份证号码:</td>
<td><input type="text" value="${person.idCard }" name="idCard" /></td>
</tr>
<tr>
<tr>
<td>手机号:</td>
<td><input type="text" value="${person.phone }" name="phone" /></td>
</tr>
<tr>
<td>地址:</td>
<td><input type="text" value="${person.address }" name="address" /></td>
</tr>
<tr>
<td align="right">
<input type="submit" value="添加" /> &nbsp;&nbsp;<a href="javascript:history.go(-1)">退回 </a>
</tr>
</table>
</form>
</body>
</html>

savePerson.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h3>员工编辑</h3>
<br />
<br />
<form id="saveForm" action="${pageContext.request.contextPath}/person/updatePerson" method="post">
<input type="hidden" name="id" value="${person.id }" />
<table style="font-size: :16px">
<tr>
<td>姓名:</td>
<td><input type="text" value="${person.name }" name="name" /></td>
</tr>
<tr>
<td>身份证号码:</td>
<td><input type="text" value="${person.idCard }" name="idCard" /></td>
</tr>
<tr>
<tr>
<td>手机号:</td>
<td><input type="text" value="${person.phone }" name="phone" /></td>
</tr>
<tr>
<td>地址:</td>
<td><input type="text" value="${person.address }" name="address" /></td>
</tr>
<tr>
<td align="right">
<input type="submit" value="更新" /> &nbsp;&nbsp;<a href="javascript:history.go(-1)">退回 </a>
</tr>
</table>
</form>
</body>
</html>

最后

以上就是瘦瘦花生为你收集整理的SSH spring+springmvc+hibernate+maven 整合详解的全部内容,希望文章能够帮你解决SSH spring+springmvc+hibernate+maven 整合详解所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(46)

评论列表共有 0 条评论

立即
投稿
返回
顶部