📄 menu.jsp
字号:
<%@ page language="java" contentType="text/html; charset=gb2312"
pageEncoding="GBK" import="java.util.*"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:if test="${empty menu}">
<c:set var="title" value="新增菜单"/>
<c:set var="method" value="add"/>
</c:if>
<c:if test="${not(empty menu)}">
<c:set var="title" value="编辑菜单"/>
<c:set var="method" value="update"/>
</c:if>
<!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=gb2312">
<title>${title}</title>
<style type="text/css">
<!--
.ziti {
font-size: 12px;
}
.font_red {
color:red;
font-size: 12px;
}
.bian {
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #009966;
border-right-color: #009966;
border-bottom-color: #009966;
border-left-color: #009966;
}
body {
background-image: url(../../Images/dw.gif);
}
-->
</style>
<script type="text/javascript">
function notDoK(){
var error=0;
var mynameobj = document.getElementById("menuName");
var nameobj = document.getElementById("pname");
if(mynameobj.value==""){
nameobj.innerHTML="*菜单名称不能为空!";
mynameobj.focus();
error=1;
}else{
nameobj.innerHTML="";
}
if(error==0){
document.getElementById("myfrom").submit();
}
}
</script>
</head>
<body>
<h2>${title}</h2>
<c:url value="/MenuServlet" var="add"/>
<form action="${add}" method="post" id="myfrom">
<input type="hidden" name="method" value="${method}"/>
<input type="hidden" name="menuId" value="${menu.menuId}"/>
<table width="500" border="0" align="center">
<tr>
<td width="120" align="right" class="ziti">父ID:</td>
<td>
<select name="parentMenuId">
<c:if test="${menu.parentMenuId==0}">
<c:set var="sel" value="selected" />
</c:if>
<option value="0" ${sel}>根级菜单</option>
<c:forEach items="${parentMenus}" var="parent">
<c:set var="sel" value="" />
<c:if test="${menu.parentMenuId==parent.menuId}">
<c:set var="sel" value="selected" />
</c:if>
<option value="${parent.menuId}" ${sel}>${parent.menuName}</option>
</c:forEach>
</select>
</td>
</tr>
<tr>
<td width="120" align="right" class="ziti">菜单名称:</td>
<td><input name="menuName" id="menuName" type="text" class="bian" size="20" value="${menu.menuName}"><span id="pname" name="pname" class="font_red"></td>
</tr>
<tr>
<td width="120" align="right" class="ziti">菜单路径:</td>
<td><input name="menuLink" type="text" class="bian" size="20" value="${menu.menuLink}"></td>
</tr>
<tr>
<td width="120" align="right"> </td>
<td><input name="Submit" type="button" class="ziti" value="提 交" onClick="notDoK()"></td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -