SSH框架整合-myeclipse
项目结构
1.mysql数据库 stuinfo
/*
SQLyog 企业版 - MySQL GUI v8.14
MySQL - 5.5.40 : Database - stuinfo
*********************************************************************
*/ CREATE DATABASE /*!32312 IF NOT EXISTS*/`stuinfo` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */; USE `stuinfo`; /*Table structure for table `classes` */ DROP TABLE IF EXISTS `classes`; CREATE TABLE `classes` (
`id` int(12) NOT NULL AUTO_INCREMENT,
`name` varchar(11) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; /*Data for the table `classes` */ insert into `classes`(`id`,`name`) values (1,'y2134'),(2,'s2188'),(3,'s2192'); /*Table structure for table `student` */ DROP TABLE IF EXISTS `student`; CREATE TABLE `student` (
`id` int(12) NOT NULL AUTO_INCREMENT COMMENT '学员编号',
`name` varchar(11) COLLATE utf8_bin NOT NULL COMMENT '姓名',
`age` int(12) NOT NULL COMMENT '年龄',
`gender` char(2) COLLATE utf8_bin NOT NULL COMMENT '性别',
`telephone` varchar(11) COLLATE utf8_bin NOT NULL COMMENT '电话',
`email` varchar(32) COLLATE utf8_bin NOT NULL COMMENT 'Email',
`classId` int(12) NOT NULL COMMENT '班级编号',
PRIMARY KEY (`id`),
KEY `FK_student` (`classId`),
CONSTRAINT `FK_student` FOREIGN KEY (`classId`) REFERENCES `classes` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; /*Data for the table `student` */ insert into `student`(`id`,`name`,`age`,`gender`,`telephone`,`email`,`classId`) values (1,'何东东',20,'男','13910101000','hdd@accp.co',1),(2,'付好',23,'男','18856906326','fuhao@126.com',2),(3,'李建达',24,'男','18888888888','lijianda@qq.com',2),(4,'lucy',20,'女','15852033216','lucy@qq.com',3),(5,'李健',25,'男','13956063365','liyang1@126.com',2),(6,'李健康',20,'男','13956063369','lijiankang@126.com',1);
stuinfo
2. 数据库配置文件
driverClass=com.mysql.jdbc.Driver
jdbcUrl=jdbc\:mysql\://localhost\:3306/stuinfo?characterEncoding\=utf8
user=root
password=root
3. 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:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd ">
<!-- 1.add spring capabilitise -->
<!-- 注解扫描包 -->
<context:component-scan base-package="cn.stu" />
<!-- 读取数据库配置文件 -->
<context:property-placeholder location="classpath:jdbc.properties" />
<!-- 打开事务注解 -->
<tx:annotation-driven />
<!-- 数据源配置 -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="${driverClass}" />
<property name="jdbcUrl" value="${jdbcUrl}" />
<property name="user" value="${user}" />
<property name="password" value="${password}" />
</bean> <!-- sessionFactory配置 -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="hibernateProperties">
<props>
<!-- hibernate方言配置 -->
<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
<!-- 配置hibernate 控制台打印查询sql -->
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop>
</props>
</property>
<property name="mappingLocations" value="classpath:cn/stu/entity/*.hbm.xml"></property>
</bean>
<!-- hibernate方言配置 -->
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<!-- hibernateTemplate bean -->
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
</beans>
applictaionContext.xml
4.hibernate配置文件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"> <!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration> <session-factory>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/stuinfo
</property>
<property name="connection.username">root</property>
<property name="connection.password">root</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="myeclipse.connection.profile">mysql</property>
<mapping resource="cn/stu/entity/Student.hbm.xml" />
<mapping resource="cn/stu/entity/Classes.hbm.xml" /> </session-factory> </hibernate-configuration>
hibernate.cfg.xml
5. strus配置文件
<?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">
<action name="stuListPage" class="cn.stu.aciton.StuAction" method="stuListPage">
<!--result不写name,默认name值是success -->
<result>/index.jsp</result>
</action> <action name="stuAddPage" class="cn.stu.aciton.StuAction" method="stuAddPage">
<result>/addPage.jsp</result>
</action> <action name="addStu" class="cn.stu.aciton.StuAction" method="addStu">
<result name="success" type="redirectAction">stuListPage</result> <!-- 保存成功,重定向到显示页面 -->
<result name="failed" >/addPage.jsp</result>
</action> <action name="deleteClasses" class="cn.stu.aciton.StuAction" method="delStu">
<result name="success" type="redirectAction">stuListPage</result>
</action>
</package> </struts>
struts.xml
6. JavaBean和 hibernate sql映射文件(反向工具自动生成,手动写的话,只需写Classes Student两个类就行了)
package cn.stu.entity; import java.util.HashSet;
import java.util.Set; /**
* AbstractClasses entity provides the base persistence definition of the
* Classes entity. @author MyEclipse Persistence Tools
*/ public abstract class AbstractClasses implements java.io.Serializable { // Fields private Integer id;
private String name;
private Set students = new HashSet(0); public AbstractClasses() {
} public AbstractClasses(String name) {
this.name = name;
} public AbstractClasses(String name, Set students) {
this.name = name;
this.students = students;
} // Property accessors public Integer getId() {
return this.id;
} public void setId(Integer id) {
this.id = id;
} public String getName() {
return this.name;
} public void setName(String name) {
this.name = name;
} public Set getStudents() {
return this.students;
} public void setStudents(Set students) {
this.students = students;
} // @Override
// public String toString() {
// return "AbstractClasses [id=" + id + ", name=" + name + ", students="
// + students + "]";
// } }
AbstractClasses
package cn.stu.entity; /**
* AbstractStudent entity provides the base persistence definition of the
* Student entity. @author MyEclipse Persistence Tools
*/ public abstract class AbstractStudent implements java.io.Serializable { // Fields private Integer id;
private Classes classes;
private String name;
private Integer age;
private String gender;
private String telephone;
private String email; // Constructors /** default constructor */
public AbstractStudent() {
} /** full constructor */
public AbstractStudent(Classes classes, String name, Integer age,
String gender, String telephone, String email) {
this.classes = classes;
this.name = name;
this.age = age;
this.gender = gender;
this.telephone = telephone;
this.email = email;
} // Property accessors public Integer getId() {
return this.id;
} public void setId(Integer id) {
this.id = id;
} public Classes getClasses() {
return this.classes;
} public void setClasses(Classes classes) {
this.classes = classes;
} public String getName() {
return this.name;
} public void setName(String name) {
this.name = name;
} public Integer getAge() {
return this.age;
} public void setAge(Integer age) {
this.age = age;
} public String getGender() {
return this.gender;
} public void setGender(String gender) {
this.gender = gender;
} public String getTelephone() {
return this.telephone;
} public void setTelephone(String telephone) {
this.telephone = telephone;
} public String getEmail() {
return this.email;
} public void setEmail(String email) {
this.email = email;
} }
AbstractStudent
package cn.stu.entity; import java.util.Set; /**
* Classes entity. @author MyEclipse Persistence Tools
*/
public class Classes extends AbstractClasses implements java.io.Serializable { // Constructors /** default constructor */
public Classes() {
} /** minimal constructor */
public Classes(String name) {
super(name);
} /** full constructor */
public Classes(String name, Set students) {
super(name, students);
} }
Classes
package cn.stu.entity; /**
* Student entity. @author MyEclipse Persistence Tools
*/
public class Student extends AbstractStudent implements java.io.Serializable { // Constructors /** default constructor */
public Student() {
} /** full constructor */
public Student(Classes classes, String name, Integer age, String gender,
String telephone, String email) {
super(classes, name, age, gender, telephone, email);
} }
Student
<?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">
<!--
Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
<class name="cn.stu.entity.Classes" table="classes" catalog="stuinfo" lazy="false">
<id name="id" type="java.lang.Integer">
<column name="id" />
<generator class="identity" />
</id>
<property name="name" type="java.lang.String">
<column name="name" length="11" not-null="true" />
</property>
<set name="students" inverse="true">
<key>
<column name="classId" not-null="true">
<comment>班级编号</comment>
</column>
</key>
<one-to-many class="cn.stu.entity.Student" />
</set>
</class>
</hibernate-mapping>
Classes.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">
<!--
Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
<class name="cn.stu.entity.Student" table="student" catalog="stuinfo" lazy="false">
<id name="id" type="java.lang.Integer">
<column name="id" />
<generator class="identity" />
</id>
<many-to-one name="classes" class="cn.stu.entity.Classes" fetch="select">
<column name="classId" not-null="true">
<comment>班级编号</comment>
</column>
</many-to-one>
<property name="name" type="java.lang.String">
<column name="name" length="11" not-null="true">
<comment>姓名</comment>
</column>
</property>
<property name="age" type="java.lang.Integer">
<column name="age" not-null="true">
<comment>年龄</comment>
</column>
</property>
<property name="gender" type="java.lang.String">
<column name="gender" length="2" not-null="true">
<comment>性别</comment>
</column>
</property>
<property name="telephone" type="java.lang.String">
<column name="telephone" length="11" not-null="true">
<comment>电话</comment>
</column>
</property>
<property name="email" type="java.lang.String">
<column name="email" length="11" not-null="true">
<comment>Email</comment>
</column>
</property>
</class>
</hibernate-mapping>
Student.hbm.xml
7.DAO层
package cn.stu.dao; import java.io.Serializable;
import java.util.List; import cn.stu.entity.Classes;
import cn.stu.entity.Student; public interface StuDao { /**
* 查所有学生
*
* @return
*/
List<Student> showStudnets(); /**
* 添加学生
*
* @param student
*/
void addStudent(Student student); /**
* 查所有班级列表
*
* @return
*/
List<Classes> showClasses(); /**
* 删除班级
*
* @param id
*/
void deleteClasses(Serializable id); /**
* 删除学生
*
* @param classId
*/
void deleteStudent(Serializable classId); }
StuDao
package cn.stu.dao; import java.io.Serializable;
import java.util.List; import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Repository; import cn.stu.entity.Classes;
import cn.stu.entity.Student;
/*
* @Repository注解将数据访问层 (DAO 层 ) 的类标识为 Spring Bean。
* 为了让 Spring 能够扫描类路径中的类并识别出 @Repository 注解,
* 需要在 XML 配置文件中启用Bean 的自动扫描功能,这可以通过<context:component-scan/>实现*/
@Repository //
public class StuDaoImpl implements StuDao { @Autowired //自动注入hibernateTemplate 这个bean
private HibernateTemplate hibernateTemplate; @SuppressWarnings("unchecked")
public List<Student> showStudnets() {
String hql = "from Student ";
return hibernateTemplate.find(hql);
} public void addStudent(Student student) { hibernateTemplate.save(student);
} public List<Classes> showClasses() {
String hql="from Classes";
return hibernateTemplate.find(hql); } public void deleteClasses(Serializable id) {
Classes classes = hibernateTemplate.get(Classes.class, id);
hibernateTemplate.delete(classes);
} public void deleteStudent(Serializable classId) {
//String hql = "delete from Student where classId =: classId";
//bulkUpdate方法是hibernateTemplate提供的批量删除方法!!!
hibernateTemplate.bulkUpdate("delete from Student where classId =?", new Object[]{classId}); } }
StuDaoImpl
8.Service层
package cn.stu.service; import java.io.Serializable;
import java.util.List; import cn.stu.entity.Classes;
import cn.stu.entity.Student; public interface StuService { List<Student> showStudnets(); void addStudent(Student student); List<Classes> showClasses(); void deleteClasses(Serializable id);
}
StuService
package cn.stu.service; import java.io.Serializable;
import java.util.List; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import cn.stu.dao.StuDao;
import cn.stu.entity.Classes;
import cn.stu.entity.Student; @Service
@Transactional //事务注解,后面删除功能用到了事务管理
public class StuServiceImpl implements StuService { @Autowired
private StuDao dao; public void addStudent(Student student) {
dao.addStudent(student);
} public List<Classes> showClasses() {
return dao.showClasses();
} public List<Student> showStudnets() {
return dao.showStudnets();
} @Transactional(propagation=Propagation.REQUIRED,
isolation=Isolation.DEFAULT,
rollbackFor=Exception.class)
public void deleteClasses(Serializable id){
//删除班级,同时删除该班级下的学生,写在通一个service方法里,受事务保护
System.out.println("删除班级和对应的学生,班级id:"+id);
dao.deleteStudent(id);
try {
int i=1/0;
} catch (Exception e) {
e.printStackTrace();
// throw new RuntimeException(e);//如果进行捕获,必须要手动抛出异常,否则事务不会回滚
}
dao.deleteClasses(id); } } /*
* @Transactional(propagation=Propagation.REQUIRED,
isolation=Isolation.DEFAULT,
rollbackFor=Exception.class)
public void deleteClasses(Serializable id){
//删除班级,同时删除该班级下的学生,写在通一个service方法里,受事务保护
System.out.println("删除班级和对应的学生,班级id:"+id);
try {
if(id!=null){
dao.deleteStudent(id);
int i=1/0;
dao.deleteClasses(id);//在deleteClasses方法里面制造异常,还是能完整的删除
}
} catch (Exception e) {
System.out.println("人为制造异常测试事务(删除班级及对应班级的学生)能否进行回滚!"); e.printStackTrace();
} }
* */
StuServiceImpl
9.servlet层
package cn.stu.aciton; import java.util.List; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import cn.stu.entity.Classes;
import cn.stu.entity.Student;
import cn.stu.service.StuService; import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport; /**
* 使用struts的action作为控制器
*
* @author Administrator
*
*/
@Controller
public class StuAction extends ActionSupport { private static final long serialVersionUID = 1L;
@Autowired
private StuService stuService;
private List<Student> stus = null;
private List<Classes> classes = null;
private Student student;// 用于接收表单提交的添加学生信息
private Integer classId;//要删除的班级编号————一定要生成get set方法,否则获取不到页面的参数值 public Integer getClassId() {
return classId;
} public void setClassId(Integer classId) {
this.classId = classId;
} public List<Student> getStus() {
return stus;
} public void setStus(List<Student> stus) {
this.stus = stus;
} public List<Classes> getClasses() {
return classes;
} public void setClasses(List<Classes> classes) {
this.classes = classes;
} public Student getStudent() {
return student;
} public void setStudent(Student student) {
this.student = student;
} /**
* 请求tomcat服务器http://localhost:8080/StuManagementSSH/stuListPage.action
* 跳转到学生列表显示页面
*
* @return
*/
public String stuListPage() {
System.out.println("in stuListPage method...");
stus = stuService.showStudnets();
return SUCCESS;
} /**
* 跳转到添加学生页面
*
* @return
*/
public String stuAddPage() {
classes = stuService.showClasses();
return SUCCESS;
} /**
* 添加学生页面表单提交
*
* @return
*/
public String addStu() {
try {
stuService.addStudent(student);
ActionContext context = ActionContext.getContext();
// ActionContext.getContext().getSession().put("loginUser", student);//保存信息到session中
// Map<String, Object> session = context.getSession();
// Map<String, Object> application = context.getApplication();
// Map request = (Map)context.get("request");//与context.put()相同
// context.put("name", "gree");//放到request作用域
return SUCCESS;
} catch (Exception e) { e.printStackTrace();
return "failed";
}
} public String delStu(){
stuService.deleteClasses(classId);
return SUCCESS;
}
}
StuAction
10.web.xml配置:
(1)配置OpenSessionInViewFilter,保证一次请求期间,都使用同一个session,要设置在struts核心过滤器之前
(2) struts过滤器配置
(3)创建监听器,获得spring配置文件的信息,创建容器
(4)启动时加载上下文,即加载spring
<?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> <!-- 防止懒加载异常,保证一次请求期间,都使用同一个session,要设置在struts核心过滤器之前 -->
<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> <!-- applicaionContext.xml中的sessionFactory -->
</init-param>
</filter>
<filter-mapping>
<filter-name>OpenSessionInViewFilter</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping> <!-- struts过滤器配置 -->
<filter>
<filter-name>StrutsPrepareAndExecuteFilter</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>StrutsPrepareAndExecuteFilter</filter-name>
<!-- 只要是同一个action,都在一个会话里完成 -->
<url-pattern>*.action</url-pattern>
<!-- <url-pattern>*.jsp</url-pattern> -->
</filter-mapping> <!-- 监听器,获得spring配置文件的信息,创建容器 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener> <!-- 启动时加载上下文 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param> </web-app>
web.xml
11. 学生列表显示页即添加信息页
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
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 'index.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>
stulist page. <br>
<a href="stuAddPage.action">添加学生</a>
<table border="1">
<s:iterator value="stus" var="stu">
<tr>
<td><s:property value="#stu.id"/> </td>
<td><s:property value="#stu.name"/> </td>
<td><s:property value="#stu.age"/> </td>
<td><s:property value="#stu.gender"/> </td>
<td><s:property value="#stu.telephone"/> </td>
<td><s:property value="#stu.email"/> </td>
</tr>
</s:iterator>
</table>
</body>
</html>
index.jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
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 'index.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>
add page.
<br>
<s:form action="addStu.action" method="post">
<s:textfield label="姓名" name="student.name"></s:textfield>
<s:textfield label="年龄" name="student.age"></s:textfield>
<s:textfield label="性别" name="student.gender"></s:textfield>
<s:textfield label="电话" name="student.telephone"></s:textfield>
<s:textfield label="邮箱" name="student.email"></s:textfield>
<s:select label="年级" name="student.classes.id" list="classes"
headerValue="请选择" headerKey="0" listKey="id" listValue="name">
</s:select>
<s:submit value="提交"></s:submit>
</s:form>
</body>
</html>
addPage.jsp
根据struts配置文件中配置的请求访问路径,访问 http://localhost:8080/StuManagementSSH/stuListPage.action
添加页面:(添加完成,要继续返回到列表显示页,因此添加完成后,应该重定向到请求列表页显示的那个服务)
删除功能未做
SSH框架整合-myeclipse的更多相关文章
- ssh框架整合之登录以及增删改查
1.首先阐述一下我用得开发工具,myeclipse2017+oracle,所以我的基本配置步骤可能不一样,下面我用几张图来详解我的开发步骤. ---1先配置structs (Target 选择apac ...
- SSH框架整合
SSH框架整合 一.原理图 action:(struts2) 1.获取表单的数据 2.表单的验证,例如非空验证,email验证等 3.调用service,并把数据传递给service Service: ...
- dwr与ssh框架整合教程
(1)dwr与ssh框架整合教程dwr框架介绍. DWR(Direct Web Remoting)是一个用于改善web页面与Java类交互的远程服务器端Ajax开源框架,可以帮助开 发人员开发包含AJ ...
- Spring+Hibernate+Struts(SSH)框架整合
SSH框架整合 前言:有人说,现在还是流行主流框架,SSM都出来很久了,更不要说SSH.我不以为然.现在许多公司所用的老项目还是ssh,如果改成流行框架,需要成本.比如金融IT这一块,数据库dao层还 ...
- J2EE进阶(十)SSH框架整合常见问题汇总(一)
SSH框架整合常见问题汇总(一) 前言 以下所列问题具有针对性,但是遇到同类型问题时均可按照此思路进行解决. HTTP Status 404 - No result defined for actio ...
- MVC+Spring.NET+NHibernate .NET SSH框架整合 C# 委托异步 和 async /await 两种实现的异步 如何消除点击按钮时周围出现的白线? Linq中 AsQueryable(), AsEnumerable()和ToList()的区别和用法
MVC+Spring.NET+NHibernate .NET SSH框架整合 在JAVA中,SSH框架可谓是无人不晓,就和.NET中的MVC框架一样普及.作为一个初学者,可以感受到.NET出了MV ...
- SSH框架整合的其它方式
--------------------siwuxie095 SSH 框架整合的其它方式 1.主要是整合 Spring 框架和 Hibernate 框架时,可以不写 Hibernate 核心配置文件: ...
- SSH框架整合过程总结
---------------------siwuxie095 SSH 框架整合过程总结 (一)导入相关 jar 包(共 ...
- SSH框架整合思想
--------------------siwuxie095 SSH 框架整合思想 1.SSH 框架,即 Struts2 ...
随机推荐
- 圆周运动的css3特效案例
<!doctype html><html lang="zh-cn"><head> <meta charset="UTF-8&qu ...
- ANTLR4将BF翻译成CPP
实验环境: 操作系统:windows 10 JAVA:JDK 1.8 antlr:antlr-4.7.1-complete.jar IDE:IntelliJ IDEA 2017.2.7 实验目的: 实 ...
- SQL element_at函数
库里有类似josn形式的字符串数据attr{"a":"123","b":"234"."c":&quo ...
- memcached php扩展(二)
memcached php扩展(二) 安装环境链接:http://pan.baidu.com/s/1i4IbJox Memecached 服务器安装(一) memcached php扩展(二) red ...
- linux使用pigz多线程压缩
因为tar zip是单线程的压缩,压缩起来很慢,这个使用使用pigz工具辅助就会使用多线程了. 安装 sudo apt install pigz 压缩 tar cvf - test.txt | pig ...
- 【ABAP系列】SAP ABAP基础-abap数据类型的解析整理
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP ABAP基础-abap数 ...
- MQ基础知识学习
之前听人提起了MQ协议,我就去稍微了解了一下什么是MQ,和MQ的一些基础性的知识. 什么是MQ呢? 消息队列(MQ)是一种应用程序对应用程序的通信方法.应用程序通过写和检索出入列队的针对应用程序的数据 ...
- python args参数理解
文件名:while.py 代码:import sysprint(sys.path)print(sys.argv) 执行结果: ['D:\\python_basic\\s01', 'D:\\python ...
- Mac apache You don't have permission to access / on this server.
在mac下配置完apache和php环境后,通过localhost访问页面,出现403Forbidden.页面提示: Forbidden You don't have permission to ac ...
- Codeforces 1166E(思维)
题面 有一个长度为n的序列a,有m次操作.每一次操作一个人选a的一个子集x,另一个人会选x的补集y.且x集合中的数的最小公倍数比y集合中的数的最小公倍数大.现在给出所有x,判断是否有一个序列a满足条件 ...