1、新建web project

2、ssh框架 加入到项目中去(这里不介绍,网上搜索)

3、struts2配置 http://www.cnblogs.com/istianyu/archive/2013/05/22/3093768.html

4、jsp页面 index2.jsp

 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ 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>
<title>My JSP 'index2.jsp' starting page</title>
</head>
<link href="lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<link href="lib/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
<link href="lib/ligerUI/skins/Gray/css/all.css" rel="stylesheet" type="text/css" />
<script src="lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="lib/ligerUI/js/core/base.js" type="text/javascript"></script>
<script src="lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
<script src="lib/ligerUI/js/plugins/ligerToolBar.js" type="text/javascript"></script>
<script src="lib/ligerUI/js/plugins/ligerResizable.js" type="text/javascript"></script>
<script src="lib/ligerUI/js/plugins/ligerCheckBox.js" type="text/javascript"></script>
<script src="lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
<body>
<div id="liger-grid"></div>
<script type="text/javascript">
$(function(){ $("#liger-grid").ligerGrid({
height:'auto',
width:'600px',
columns: [
{ display: 'id', name: 'studentId', align: 'center'},
{ display: '姓名', name: 'studentName'},
{ display: '年龄', name: 'studentAge'},
{ display: '年级', name: 'classes.className',render:function(data){return data.classes.className==null? "无" : data.classes.className }}
],
url: 'student.action',
pageSize:5,
rownumbers:true,
resizable :true,
dataAction:'local',
toolbar: { items: [
{ text: '增加', click: opt, icon: 'add' },
{ text: '修改', click: opt, icon: 'modify' },
{ text: '删除', click: opt, icon: 'delete' }
]
}
}); function opt(type){
var typeValue = type.icon;
var manager = $("#liger-grid").ligerGetGridManager();
var row = manager.getSelectedRow(); switch (typeValue) {
case "add":
$.ligerDialog.open({url: 'http://www.baidu.com',height: 350,width: 350});
break;
case "modify":
$.ligerDialog.open({url: 'update.jsp?studentId='+row.studentId,height: 450,width: 450}); break;
case "delete":
alert("您选择的是:" + row.studentId ); break;
}
}
});
</script>
</body>
</html>

LigerUI java SSH小例子的更多相关文章

  1. java反射小例子

    package com.txwsqk.reflect; public class Car { private String brand; private String color; private i ...

  2. JSP调用JAVA方法小例子

    用JAVA编写的函数 package doc; //定义一个包 public class Dy { //定义一个类 public static int Sub(int x,int y){ //定义函数 ...

  3. Java——多线程小例子

    body, table{font-family: 微软雅黑; font-size: 10pt} table{border-collapse: collapse; border: solid gray; ...

  4. java算法小例子

    作为一个程序员,有时候我觉得自己都不适合,因为自己数学不好,算法不好,脑子不够灵活.而对于算法,感觉就像是数学题,总觉得很难.以前上学,在班里总有几个什么都不好,但唯独数学很厉害,真气人!面对难题时, ...

  5. 一个Java线程小例子(仿火车票售卖)

    public class MyThread extends Thread{ private static int ticket=100; public void run(){ for(int i=0; ...

  6. java死锁小例子

    package cn.com.io.threadDemo.ThreadSyn; /** * 通过两个属性值创建死锁 * 本程序通过两个线程各自锁定一个属性值,这样两个线程都无法结束,造成死锁 * @a ...

  7. Java多线程小例子(三个窗口卖火车票)

    class Ticket implements Runnable{ private int TicketNum = 100; //100张火车票 private boolean flag = true ...

  8. Java一些小例子

    package com.example.demo; public class Solution { public static void main(String[] args) { func(); } ...

  9. java即时通信小例子

    学习java一段时间了,今天写来一个即时通信的小例子练手在其过程中也学到了一些知识拿出来和大家分享,请路过的各位大神多多赐教... 好了下面讲一下基本的思路: 首先,编写服务器端的程序,简单点说吧就是 ...

随机推荐

  1. [Machine Learning with Python] Cross Validation and Grid Search: An Example of KNN

    Train model: from sklearn.model_selection import GridSearchCV param_grid = [ # try 6 (3×2) combinati ...

  2. Ansible进阶之企业级应用

    1.环境 cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 ...

  3. Java命令行的基本编译运行

    1.编译 编写MyProgram.java文件,内容如下: public class MyProgram { public static void main(String[] args) { Syst ...

  4. linux基础学习8

      管理主机每天任务: 查询登录档.追踪流量.监控用户使用主机状态.主机各项硬设备状态. 主机软件更新查询.其他使用者要求: 因此shell script 就必须要学啊,虽然可以说绝大部分shell能 ...

  5. css :before 和 :after

    :before p:before 在每个 <p> 元素的内容之前插入内容. 2 :after p:after 在每个 <p> 元素的内容之后插入内容. 2 <!DOCTY ...

  6. vim学习记录(转)

    基本功 Vim有三种模式: 导航(navigation)模式. 这时候,字母就是上下左右键. 输入模式.这时候,你按字母键,才会输入字母. 命令模式.需要先输入":" 冒号,才会进 ...

  7. nginx/iptables动态IP黑白名单实现方案

    nginx/iptables动态IP黑白名单实现方案 一.手动封IP步骤 1.Nginx手动封IP 1.获取各个IP访问次数 awk '{print $1}' nginx.access.log |so ...

  8. make -j 4 echo !$

    make -j 4 #以cpu四核编译 !$上一次命令空格后的部分

  9. 移动端开发者福利-免费收费api收藏

    一 .api 1.https://www.juhe.cn/ 跟百度api集市差不多,超级赞,做好认证就行了,我有20+认证能用的免费api 2.http://apistore.baidu.com/as ...

  10. servlet实现文件下载所需步骤及说明

      servlet实现文件下载所需步骤及说明 CreateTime--2017年9月1日15:46:22 Author:Marydon 参考链接:http://blog.sina.com.cn/s/b ...