edititem_jsp.java
来自「jsp_javabean+tomcat的web管理系统!」· Java 代码 · 共 266 行
JAVA
266 行
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
public final class editItem_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static java.util.Vector _jspx_dependants;
static {
_jspx_dependants = new java.util.Vector(2);
_jspx_dependants.add("/verifys.inc");
_jspx_dependants.add("/verifyEdit.inc");
}
public java.util.List getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=gb2312");
pageContext = _jspxFactory.getPageContext(this, request, response,
"", true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write('\r');
out.write('\n');
out.write('\r');
out.write('\n');
msrv.PurviewVerify pv = null;
synchronized (_jspx_page_context) {
pv = (msrv.PurviewVerify) _jspx_page_context.getAttribute("pv", PageContext.PAGE_SCOPE);
if (pv == null){
pv = new msrv.PurviewVerify();
_jspx_page_context.setAttribute("pv", pv, PageContext.PAGE_SCOPE);
}
}
out.write('\r');
out.write('\n');
String msrvUserID="",projectID="",contextPath="",relativelyURI="",relativelyFile="";
if(session.getAttribute("msrvUserID")==null||session.getAttribute("msrvUserID").equals(""))
{
out.print("<script>alert('非法进入');window.location='main.jsp';window.parent.carnoc.location='left.jsp'</script>");
return;
}else{
msrvUserID=(String)session.getAttribute("msrvUserID");
contextPath=request.getContextPath();
relativelyURI=request.getRequestURI();
relativelyFile=relativelyURI.substring(contextPath.length()+1,relativelyURI.length());
}
pv.init(Integer.parseInt(msrvUserID),relativelyFile);
if(!pv.getViewPurview()){
out.print("<script>alert('你不具有此项权限,请与管理员联系!');</script>");
return;
}
out.write('\r');
out.write('\n');
//**********ÊÇ·ñ¾ßÓбà¼È¨ÏÞ****************************************************
if(!pv.getEditPurview()){
out.print("<script>alert('Äã²»¾ßÓдËÏîȨÏÞ£¬ÇëÓë¹ÜÀíÔ±ÁªÏµ£¡');</script>");
return;
}
//***************************************************************************
out.write('\r');
out.write('\n');
out.write('\r');
out.write('\n');
msrv.NDBConn conn = null;
synchronized (_jspx_page_context) {
conn = (msrv.NDBConn) _jspx_page_context.getAttribute("conn", PageContext.PAGE_SCOPE);
if (conn == null){
conn = new msrv.NDBConn();
_jspx_page_context.setAttribute("conn", conn, PageContext.PAGE_SCOPE);
}
}
out.write("\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
out.write("<title>无标题文档</title>\r\n");
out.write("<style type=\"text/css\">\r\n");
out.write("<!--\r\n");
out.write("body {\r\n");
out.write("\tmargin-left: 0px;\r\n");
out.write("\tmargin-top: 0px;\r\n");
out.write("\tmargin-right: 0px;\r\n");
out.write("}\r\n");
out.write(".style1 {color: #FFFFFF}\r\n");
out.write("-->\r\n");
out.write("</style>\r\n");
out.write("<link href=\"css/all.css\" rel=\"stylesheet\" type=\"text/css\">\r\n");
out.write("</head>\r\n");
out.write("\r\n");
out.write("<body>\r\n");
String tsp_id="",itemName="",itemParentID="",itemListID="",itemUrl="",itemHavePurview="",itemStatus="",itemDescription="";
String sql="",childFileSql="",childFildURLS="";
ResultSet rs=null,rsChild=null;
if(request.getParameter("tsp_id")!=null) tsp_id=request.getParameter("tsp_id");
else{
out.print("<script>window.history.back();</script>");
return;
}
sql="select tsp_name,tsp_listID,tsp_parentID,tsp_url,tsp_havePurview,tsp_status,tsp_description from tb_srv_proj where tsp_id="+tsp_id;
childFileSql="select tspf_Url from tb_srv_projectFiles where tspf_parentID="+tsp_id;
try{
rs=conn.executeQuery(sql);
rsChild=conn.executeQuery(childFileSql);
}catch(SQLException ex){out.print(ex.getMessage());}
try{
while(rs.next()){
itemName=rs.getString(1);
itemListID=rs.getString(2);
itemParentID=rs.getString(3);
itemUrl=rs.getString(4);
itemHavePurview=rs.getString(5);
itemStatus=rs.getString(6);
itemDescription=rs.getString(7);
}
while(rsChild.next()){
childFildURLS+=rsChild.getString(1)+"\n";
}
}catch(SQLException ex){out.print(ex.getMessage());}
finally{
try{
if(rs!=null){
rs.close();
rs=null;
}
if(rsChild!=null){
rsChild.close();
rsChild=null;
}
}catch(SQLException ex){out.print(ex.getMessage());}
}
out.write("\r\n");
out.write("<table width=\"102%\" height=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#808080\">\r\n");
out.write(" <tr>\r\n");
out.write(" <td height=\"23\"> <span class=\"style1\">后台管理--项目管理--编辑项目</span></td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td align=\"center\" valign=\"top\" bgcolor=\"#FFFFFF\"><br> <table width=\"85%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#CCCCCC\">\r\n");
out.write(" <tr bgcolor=\"#F2F2F2\">\r\n");
out.write(" <td height=\"20\" colspan=\"2\"> 项目内容</td>\r\n");
out.write(" </tr>\r\n");
out.write("\t <form name=\"form1\" action=\"msrv.ItemManage.Item\" method=\"post\">\r\n");
out.write(" <tr>\r\n");
out.write(" <td width=\"14%\" height=\"17\" bgcolor=\"#FFFFFF\"> 项目名称</td>\r\n");
out.write(" <td width=\"86%\" bgcolor=\"#FFFFFF\"><input name=\"itemName\" type=\"text\" value=\"");
out.print(itemName);
out.write("\" class=\"textbox\" id=\"itemName\">\r\n");
out.write("\t\t<input type=\"hidden\" name=\"cntrl\" value=\"edit\">\r\n");
out.write("\t\t<input type=\"hidden\" name=\"tsp_id\" value=\"");
out.print(tsp_id);
out.write("\">\r\n");
out.write("\t\t<input type=\"hidden\" name=\"itemParentID\" value=\"");
out.print(itemParentID);
out.write("\">\r\n");
out.write("\t\t</td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td height=\"17\" bgcolor=\"#FFFFFF\"> 排列顺序</td>\r\n");
out.write(" <td bgcolor=\"#FFFFFF\"><input name=\"itemListID\" type=\"text\" id=\"itemListID\" value=\"");
out.print(itemListID);
out.write("\" size=\"3\"> \r\n");
out.write(" 在上下排列的时候,按数字由小到大排列</td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td height=\"17\" bgcolor=\"#FFFFFF\"> 连接地址</td>\r\n");
out.write(" <td bgcolor=\"#FFFFFF\"><input name=\"itemUrl\" type=\"text\" class=\"textbox\" id=\"itemUrl\" value=\"");
out.print(itemUrl);
out.write("\" size=\"80\"></td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td height=\"17\" bgcolor=\"#FFFFFF\"> 包含子文件</td>\r\n");
out.write(" <td valign=\"top\" bgcolor=\"#FFFFFF\"><textarea name=\"childFilesUrl\" cols=\"60\" rows=\"5\" class=\"textbox\" id=\"childFilesUrl\">");
out.print(childFildURLS);
out.write("</textarea></td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td height=\"17\" bgcolor=\"#FFFFFF\"> 可设权限</td>\r\n");
out.write(" <td bgcolor=\"#FFFFFF\">必须\r\n");
out.write(" <input ");
if(itemHavePurview.equals("1")) out.print("checked");
out.write(" name=\"havePurview\" type=\"radio\" value=\"1\" checked>\r\n");
out.write(" 不用\r\n");
out.write(" <input ");
if(itemHavePurview.equals("0")) out.print("checked");
out.write(" type=\"radio\" name=\"havePurview\" value=\"0\"></td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td height=\"17\" bgcolor=\"#FFFFFF\"> 启用状态</td>\r\n");
out.write(" <td bgcolor=\"#FFFFFF\"> 启用\r\n");
out.write(" <input name=\"itemStatus\" ");
if(itemStatus.equals("1")) out.print("checked");
out.write(" type=\"radio\" value=\"1\">\r\n");
out.write(" 禁用\r\n");
out.write(" <input type=\"radio\" ");
if(itemStatus.equals("0")) out.print("checked");
out.write(" name=\"itemStatus\" value=\"0\"></td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td height=\"118\" valign=\"top\" bgcolor=\"#FFFFFF\"> 项目描述</td>\r\n");
out.write(" <td valign=\"top\" bgcolor=\"#FFFFFF\"><textarea name=\"itemDescription\" cols=\"80\" rows=\"8\" class=\"textbox\" id=\"itemDescription\">");
out.print(itemDescription);
out.write("</textarea></td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td height=\"17\" bgcolor=\"#FFFFFF\"> </td>\r\n");
out.write(" <td bgcolor=\"#FFFFFF\"><input name=\"Submit\" type=\"submit\" class=\"button\" value=\"提交\"></td>\r\n");
out.write(" </tr>\r\n");
out.write("\t </form>\r\n");
out.write(" <tr>\r\n");
out.write(" <td height=\"5\" colspan=\"2\" bgcolor=\"#F2F2F2\"></td>\r\n");
out.write(" </tr>\r\n");
out.write(" </table> </td>\r\n");
out.write(" </tr>\r\n");
out.write("</table>\r\n");
conn.close();
out.write("\r\n");
out.write("</body>\r\n");
out.write("</html>\r\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?