?? 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>錯(cuò)誤的登陸來源,請正確登陸!</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>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -