- 浏览: 203423 次
- 性别:
- 来自: 上海
-
文章分类
最新评论
-
qiankai86:
s
多个文件上传的功能 -
zhjxzhj:
经测试不能用
PDF破解软件 -
meadlai:
很不错...哈哈...
PDF破解软件 -
talin2010:
刚学了,复习一下。。
Mysql+tomcat连接池自己的例子 -
yshuaiwen:
上面的方法都不怎么好,太麻烦,而且都需要改tomcat的xml ...
Mysql+tomcat连接池的配置实例
在数据库中
System.do?method=toMenuManager
其中"agentList" 对应jsp页面中的
c:forEach var="group" items="${requestScope.agentList}" varStatus="status">
"managerList" 对应jsp页面中的
<c:forEach var="group" items="${requestScope.managerList}" varStatus="status">
this.getPrivilegeDAO() 这个
1.在action中 private PrivilegeDAO privilegeDAO; set/get 出来的
2.需要在
findByGroupType22(1)
方法
findByGroupType33(0)
方法
当类型更改的时候菜单配置列表会有相应的变化
这个是jsp页面
其中
//为了到action中
action="../../../system.do"
//为了支持JavaScript脚本
<script type="text/javascript" src="menu.js"></script>
//为了能够调用脚本中的menuUpdate方法 跳转到action中去
<input type=hidden name=method id=method value="menuUpdate">
//为了 在提交的时候有个默认被选中,否则提交的时候为空,出现问题
<option value="1" selected="selected">坐席</option>
onclick="toUpdate() 跳转到js文件中的toUpdate方法中
menu.js文件
System.do?method=toMenuManager
/** * 显示到菜单配置页面 */ public ActionForward toMenuManager(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { request.setAttribute("agentList", this.getPrivilegeDAO() .findByGroupType22(1)); request.setAttribute("managerList", this.getPrivilegeDAO() .findByGroupType33(0)); return mapping.findForward("toMenuManager"); }
其中"agentList" 对应jsp页面中的
c:forEach var="group" items="${requestScope.agentList}" varStatus="status">
"managerList" 对应jsp页面中的
<c:forEach var="group" items="${requestScope.managerList}" varStatus="status">
this.getPrivilegeDAO() 这个
1.在action中 private PrivilegeDAO privilegeDAO; set/get 出来的
2.需要在
appilicationContext.xml <bean name="/system" class="com.et.struts.action.SystemAction" singleton="false"> <property name="privilegeDAO"> <ref bean="privilegeDAO" /> </property>
findByGroupType22(1)
方法
public List findByGroupType22(Integer privilegeType){// String hql="from Privilege where PrivilegeType='1' order by PIndex"; return this.hibernateHelper.query(hql); }
findByGroupType33(0)
方法
public List findByGroupType33(Integer privilegeType){// String hql="from Privilege where PrivilegeType='0' order by PIndex"; return this.hibernateHelper.query(hql); }
当类型更改的时候菜单配置列表会有相应的变化
这个是jsp页面
<%@ page language="java" pageEncoding="GBK"%> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html:html lang="true"> <head> <html:base /> <title>menuManager.jsp</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 href="../css/admin.css" type="text/css" rel="stylesheet" /> <link href="../../css/body.css" type="text/css" rel="stylesheet" /> <link href="agent.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="menu.js"></script> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> </head> <body bgcolor="#8CBAEB"> <div class="div_main" > <table width="400px" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr > <td class="div_title" >菜单配置</td> </tr> <tr > <td class="div_body" bgcolor="F8FCFD"> <form id="main" action="../../../system.do" method="post"> <input type=hidden name=method id=method value="menuUpdate"> <table class="div_table" bgcolor="F8FCFD" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#E0E0E0" > <tr> <td width="17%" align="center" valign="top">类型:</td> <td width="34%" align="left"> <select name="type" id="type" onclick="selChange(this.value)"> <option value="1" selected="selected">坐席</option> <option value="0">管理</option> </select> </td> </tr> <table> <tr> <td width="17%" align="center" valign="top">菜单配置列表:</td> <td width="34%" align="left"> <div id="agent1" align="center"> <select name="agent" size="15" multiple="multiple"> <c:forEach var="group" items="${requestScope.agentList}" varStatus="status"> <option value="${group.pid}">${group.privilegeName}</option> </c:forEach> </select> <label> <input type="button" name="button" value="上移" onclick="Moveup(agent)"> <input type="button" name="button" value="下移" onclick="Movedown(agent)"> </label> </div> <div id="manager1" style="display: none" align="center"> <select name="manager" size="15" multiple="multiple" > <c:forEach var="group" items="${requestScope.managerList}" varStatus="status"> <option value="${group.pid}">${group.privilegeName}</option> </c:forEach> </select> <label> <input type="button" name="button" value="上移" onclick="Moveup(manager)"> </label> <label> <input type="button" name="button" value="下移" onclick="Movedown(manager)"> </label> </div> </td> </tr> </table> <tr> <td height="30" colspan="2" align="center"><input name="botton" type="button" class="button1" value="提 交" onclick="toUpdate()"/> </tr> </table> </form> </td> </tr> </table> </div> </body> </html:html>
其中
//为了到action中
action="../../../system.do"
//为了支持JavaScript脚本
<script type="text/javascript" src="menu.js"></script>
//为了能够调用脚本中的menuUpdate方法 跳转到action中去
<input type=hidden name=method id=method value="menuUpdate">
//为了 在提交的时候有个默认被选中,否则提交的时候为空,出现问题
<option value="1" selected="selected">坐席</option>
onclick="toUpdate() 跳转到js文件中的toUpdate方法中
menu.js文件
/** *按照类型能够取得出来下拉列表 */ function toUpdate() { var typeObj = document.getElementById("type"); //alert(typeObj.value); //按照管理类型把所有的列表选项都给选中 if(typeObj.value=='0'){ var managerObj = document.getElementById("manager"); for (var i=0;i<managerObj.length;i++){ managerObj.options[i].selected=true; } } //按照坐席类型把所有的列表选项都给选中 if(typeObj.value=='1'){ var agentObj = document.getElementById("agent"); for (var i=0;i<agentObj.length;i++){ agentObj.options[i].selected=true; } } //提交到action方法中 var method = document.getElementById("method"); method.value = "menuUpdate"; var mainForm = document.getElementById("main"); mainForm.submit(); }
/** * 更新数据库菜单 */ public ActionForward menuUpdate(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { String type = request.getParameter("type"); String groupName[] = null; if ("0".equals(type)) { groupName = request.getParameterValues("manager"); } if ("1".equals(type)) { groupName = request.getParameterValues("agent"); } if (groupName != null && groupName.length > 0) { this.getPrivilegeDAO().update(groupName); } return mapping.findForward("ok"); }
发表评论
-
查询2个表比较然后做下拉菜单显示
2008-09-20 19:06 1129查询2个表比较然后做下拉菜单显示 这段代码是在Main ... -
where 1 = 1
2008-09-04 17:44 1348[转]sql语句中where 1=1的作用 2008-08-2 ... -
工作中的连接池用法
2008-09-03 06:39 1181实际工作中连接池的应用 在 web.xml中 &l ... -
spring注入的例子
2008-08-31 21:35 1127关于注入机制的例子 在applicationContext. ... -
log4j自己的一个实例
2008-08-22 13:40 1144程序启动的时候首先启动web.xml中的servlet中log ... -
log4j
2008-08-22 13:39 827log4j 在强调可重用组件开发的今天,除了自己从 ... -
servlet中配置文件web.xml中的参数context-param和init-param区别
2008-08-22 13:05 2750servlet中配置文件web.xml中的参数context- ... -
在myeclipse中实现javascipt 的快捷键
2008-08-07 03:38 968在windows下面的preference下面的Genaral ... -
Myeclipse中,在导入脚本中出现乱码的问题的解决方法。
2008-08-07 03:36 1726在windows 下面的preferences 下面的Gena ... -
多个文件上传的功能
2008-08-07 02:16 3376这里用到的是用commons-fileupload-1.2.1 ... -
Mysql+tomcat连接池自己的例子
2008-07-31 23:18 23311.把MySQL-Connector-java-3.0.12- ... -
Mysql+tomcat连接池的配置实例
2008-07-31 23:03 2807特别感谢:robustwang 在Java Web开发中都 ... -
从数据库中读取数据(AJAX版本)
2008-07-30 21:33 4012现在是用ajax 做从数据库读取数据的例子 1个jsp Re ... -
从数据库中读取数据(直连版本)
2008-07-30 18:06 1859从数据库中读取数据(直连版本) 下面的这里例子实现的是在注册 ... -
Tomcat 的数据库连接池设置与应用
2008-07-29 21:33 1105Tomcat 的数据库连接池设置与应用 1.将数据库驱 ... -
session对象使用示例
2008-07-27 19:41 1276携带用户名往下跳转的 ... -
JDBC使用步骤
2008-07-24 18:42 6311分为6个步骤 1. load the driver (1) ... -
CSS鼠标移至此处, 背景变化例子
2008-07-24 17:33 1866鼠标移至此处, 背景变化的CSS例子 保存格式以jsp或者是 ... -
CSS背景颜色例子
2008-07-24 17:28 1989一个 有关 CSS 样式的小例子 建立一个 1.jsp ... -
Struts学习笔记2——文件过滤
2008-07-23 22:09 1045文件过滤功能 根据前面的struts学习笔记1 来继续我们下面 ...
相关推荐
在易语言中实现"上下移超级列表项"的功能,涉及到以下几个关键知识点: 1. **易语言基础**:易语言由王江民先生创建,它的设计理念是“易学易用”,提供了一种与自然语言接近的编程方式。了解易语言的基本语法、...
本项目提供了一个可上下滑动的3级菜单解决方案,适用于各种需要多层次菜单的场景。这种菜单设计允许用户轻松浏览长内容,提升了用户体验。 首先,我们需要理解JavaScript的基本概念。JavaScript是一种解释型的、...
此程序旨在实现一个基于LCD1602的菜单系统,允许用户通过串行通信接口与设备交互,进行上下移动菜单、进入子菜单或退出当前菜单的操作。 首先,我们要理解LCD1602的基本工作原理。它通常采用4线或8线的SPI或I²C...
MyMenu可能是源代码的主类或者库模块,开发者可以通过导入和配置这个模块,轻松地在自己的应用中实现类似的功能。 总的来说,"【Android】自定义左右滑动菜单"项目涵盖了Android UI设计、手势识别、动画实现和...
它通常被用于主屏幕的左侧或右侧,以展示更多的功能选项或者设置。用户通过简单的手势,如从屏幕边缘向内滑动,就可以打开或关闭这个菜单,这种设计极大地增强了应用的可用性和可发现性。 2. **实现原理** ...
置顶功能可将选中行移到数据集的开头,置尾则移到末尾。这同样需要根据当前选中行的索引,调用`DataGridView.Rows.Insert`或`RemoveAt`方法。 6. **XML数据存储和加载**: 使用C#的`System.Xml`命名空间来处理XML...
在实验描述中提到的"鼠标画线"功能,可能使用了这样的机制:当鼠标按下并移动时,记录起点和终点,然后在OpenGL上下文中绘制线条。这通常涉及`glBegin()`和`glEnd()`函数之间的顶点绘制,以及可能使用`glLineWidth()...
使用此类库时,开发者需要在主布局中添加菜单视图,并在Activity中初始化和配置ResideMenu。然后,通过监听触摸事件,结合ResideMenu提供的API,可以轻松地实现滑动菜单的开启和关闭。 总之,这个压缩包提供的资源...
此程序内嵌于BIOS,用于配置SAS控制器,主要功能包括创建、配置、管理逻辑驱动器,以及驱动器的初始化和重新扫描。 在配置阵列前,需对硬盘进行初始化,这一步骤会清除硬盘上的所有数据和阵列信息,请谨慎操作。...
3. **激活热备功能**:在配置界面中找到热备相关的设置选项,并激活热备功能。 4. **监控状态**:定期检查热备盘的状态,确保其正常工作且随时可用。 通过以上步骤,用户可以在Dell PowerEdge服务器上成功配置磁盘...
“多屏使用者更加合适”进一步强调了这个功能对于有多个显示器配置的用户来说尤其有用。多屏环境可以同时打开多个应用程序或窗口,而鼠标边缘扩展则能更顺畅地在这些窗口间导航,无需物理上大幅度移动鼠标。 “安装...
本主题聚焦于一个特定的应用场景——"列表li上下交换位置动画",这是一种常见于网页交互设计中的功能,特别是对于数据列表、菜单或者评分系统等元素的排序。下面将详细阐述这一知识点及其相关实现方法。 首先,我们...
3. 配置VB IDE:重启VB IDE,进入“工具”菜单,找到“选项”或“插件管理器”,在其中激活或配置新安装的滚轮插件。 4. 测试功能:在代码编辑窗口中尝试使用鼠标滚轮,如果一切正常,应该可以看到代码上下滚动。 ...
1. **参数设置**:例如,将仪表的量程由0—10kPa更改为-5—25kPa,需要通过菜单进入相关参数页面,然后使用数字键设定新的上下限值。 2. **自动调零设置**:在菜单中找到零点调整选项,按照提示操作即可使仪表进入...
- **多画面模式**:在多画面显示时,将鼠标移到所需控制的通道上,右键菜单选择“云台控制”,即可打开控制窗口。 - **单画面模式**:在单画面模式下,同样通过右键菜单的“云台控制”激活控制功能。 云台控制窗口...
鼠标指向图片移到位置,可以对图片细节进行观看,同时支持商品图片批量上传,对已上传的图片可以重复调用,系统还支持某些行业的尺码与颜色选择功能,以及购买量的设置,同时支持网页分享与收藏功能,最大限度的留住...
在主菜单中你可以选择不同的设置选项,按上下左右方向键来选择,按“Enter”键进入子菜单。 1. 功能键说明 (向上键)移到上一个选项 (向下键)移到下一个选项 (向左键)移到左边的选项 (向右键)移到右边的...
*平移模型:同时按下 SHIFT 键和鼠标键 2,移动鼠标,可将模型按鼠标移动方向平移。 *方框放大:同时按下 Ctrl 和 shift 键以及鼠标中键,画出一个方框,可放大方框所包含的区域。 *旋转模型:按下并保持鼠标中键,...
- **选项配置:** `Option`菜单包含了程序各个功能的详细设置选项,也可通过对应功能窗口内的`Option`按钮进行快速访问。 - **单位系统:** AIM2000使用原子单位体系,坐标采用波尔半径作为单位(1波尔=0....