📄 cataedit.jsp
字号:
<%@ page contentType="text/html; charset=GBK"%>
<%@ page import="blog.*,java.util.*"%>
<%--
// cataedit.jsp
// 分类管理处理页面
//
--%>
<HTML>
<HEAD>
<TITLE>Java Coffee-分类管理</TITLE>
<LINK rev=stylesheet media=screen href="css/admin.css" type=text/css
rel=stylesheet>
</HEAD>
<BODY>
<%request.setCharacterEncoding("GBK");
CUser userData = (CUser)session.getAttribute("userData");
if(userData.isEmpty()){
out.println("<font color=\"red\"><h1>错误的登陆来源,请正确登陆!</h1></font>");
}else{
Enumeration eParam = null;
eParam = request.getParameterNames();
ArrayList paraList = null;
paraList = new ArrayList();
while(eParam.hasMoreElements()){
paraList.add((String)eParam.nextElement());
}
String action = null;
int cataID = 0;
String cataName = "";
String cataIntro = "";
String button="";
if(paraList.size() != 0){
String[] strType = new String[paraList.size()];
CCataDAO cataDao = CCataDAO.newInstance();
for(int i = 0 ;i<paraList.size();i++){
strType[i] = (String )paraList.get(i);
}
String strValue = (String)request.getParameter(strType[0]);
if(strValue.equals("CataDel")){
String strID = (String)request.getParameter(strType[1]);
cataID = Integer.parseInt(strID);
cataName = cataDao.queryByID(cataID);
action = "deleteCata";
cataIntro = "";
button="删除";
}else if(strValue.equals("CataEdt")){
String strID = (String)request.getParameter(strType[1]);
cataID = Integer.parseInt(strID);
cataName = cataDao.queryByID(cataID);
action = "updateCata";
cataIntro = "";
button = "修改";
}
}else{
cataName = "";
cataIntro = "";
action = "newCata";
button = "提交";
}
%>
<DIV id=divSidebar>
<DIV id=divTitle><IMG title="RainbowSoft Studio Z-Blog"
src="images/titlezblog.gif"></DIV>
<DIV id=divManage>
<UL>
<LI><A href="cmd.jsp?act=catamanage">返回</A></LI>
</UL>
</DIV>
</DIV>
<DIV id=divMain2>
<DIV class=form>
<FORM id=edit name=edit method=post action="control.do">
<P>名称:</P>
<P><INPUT id=edtName size=40 name=edtName value=<%=cataName%>></P>
<P></P>
<P>摘要:</P>
<P><INPUT id=edtIntro size=80 name=edtIntro value=<%=cataIntro %>></P>
<P></P>
<P><INPUT class=button id=btnPost onclick="return checkCateInfo();"
type=submit value=<%=button %>></P>
<P></P>
<input type="hidden" name="action" value=<%=action %> />
<input type="hidden" name="module" value="catalog" />
<%
if(cataID != 0){%>
<input type="hidden" name="cataID" value=<%=cataID %> />
<%} %>
</FORM>
</DIV>
</DIV>
<SCRIPT>
var str17="名称不能为空";
function checkCateInfo(){
if(!document.getElementById("edtName").value){
alert(str17);
return false
}
}
</SCRIPT>
<%} %>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -