日期:2014-05-16 浏览次数:20386 次
本博客讲述如何利用js+ssh2实现重命名的判断,希望读者看完了博客能够将这个简单的小功能实现了。
首先建立一个添加系统的一个页面:
<%@ page contentType="text/html;charset=utf-8" language="java" import="java.sql.*" errorPage=""%> <% Stringpath = request.getContextPath(); StringbasePath = request.getScheme() + "://" +request.getServerName() + ":" + request.getServerPort() +path + "/"; %> <!DOCTYPE html PUBLIC "-//W3C//DTDXHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <base href="<%=basePath%>"/> <meta http-equiv="Content-Type"content="text/html; charset=utf-8" /> <title>权限管理</title> <link href="<%=basePath%>css/basePage.css"rel="stylesheet" type="text/css" /> <link href="<%=basePath%>css/baseStyle.css"rel="stylesheet" type="text/css" /> <link rel="stylesheet"type="text/css" href="<%=basePath%>css/addccStyle.css" /> <script src="<%=basePath%>/js/client_validate.js"type="text/javascript"></script> <script language="javascript"type="text/javascript"> function menu_click(page){ window.self.location= '<%=basePath%>' + page; } function _addbtn(){ var systemName =document.getElementById("systemName"); if (trim(systemName.value) == "") { alert("系统名称名称不能为空!"); systemName.focus(); return; } var myForm =document.forms[0]; myForm.action= "webSystemManager!addWebSystem"; myForm.submit(); } function _goback(){ window.self.location= "<%=basePath%>permission/sysmgr/system_add.jsp"; } function init() { var systemName =document.getElementById("systemName"); var s = '<%=request.getAttribute("system_isExist")%>'; if(s == "1"){ alert("该系统已经存在!"); systemName.focus(); systemName.value=""; return; } var res = "<%=request.getAttribute("addRes")%>"; if(res == 1){ alert("添加成功!"); systemName.focus(); systemName.value=""; return; } systemName.focus(); } </script> </head> <body menu='menu' onload="init()"> <div class="header"> <div class="header03"></div> <div class="header01"></div> <div class="header02">权限管理系统</div> </div> <div class="left" id="LeftBox"> <div class="left01"> <div class="left01_right"></div> <div class="left01_left"></div> <div class="left01_c">超级管理员:admin</div> </div> <div class="left02"> <div class="left02top"> <div class="left02top_right"></div> <div class="left02top_left"></div> <div class="left02top_c">基本信息维护</div> </div> <div class="left02down"> <div class="left02down01" onclick="me