newarticle_do.jsp~27~
资源名称:bangong.rar [点击查看]
上传用户:dlqqsh
上传日期:2021-11-13
资源大小:7840k
文件大小:2k
源码类别:
OA系统
开发平台:
Java
- <%@ page contentType="text/html; charset=GBK" import="java.sql.*,java.lang.*" buffer="64kb" %>
- <%request.setCharacterEncoding("gbk"); %>
- <html>
- <head>
- <title>
- newarticle_do
- </title>
- </head>
- <jsp:useBean id="sql" scope="page" class="control.sqlcontrol" />
- <jsp:useBean id="file" scope="page" class="control.Filecontrol.Reader_Writer" />
- <body bgcolor="#ffffff">
- <%try{
- sql.getSQL2005conn("dbconfig.xml");
- String title = request.getParameter("title");
- String users = request.getParameter("users");
- String url = request.getParameter("article_contexturl");
- String type = request.getParameter("type");
- String depar = request.getParameter("depar");
- String time = request.getParameter("time1");
- if(title==null||title.equals("")||title.equals(null)||title.trim().equals("")){
- out.print("<h3 align="center">标题不能为空!请返回重填!</h3>");
- out.print("还要一个返回链接!");
- }else{
- String path =application.getRealPath("article")+"\"+url;
- String contant = request.getParameter("context");
- file.WriteFile(path,contant);
- StringBuffer getselect = new StringBuffer();
- getselect.append("insert into article(");
- getselect.append("users,");
- getselect.append("depar,");
- getselect.append("title,");
- getselect.append("date,");
- getselect.append("context,");
- getselect.append("type) values (");
- getselect.append("'"+users+"','"+depar+"','"+title+"','"+time+"','"+url+"','"+type+"');");
- String select = getselect.toString();
- sql.MouChoose(select);
- sql.closeDB();%>
- <a onclick="">点击返回!</a>
- <h3>录入成功,请进行其他操作!</h3><hr><a href="newArticle.jsp">继续录入</a>
- <%
- }
- }catch(Exception ex){
- ex.printStackTrace();
- }
- %>
- <div align="center">
- </div>
- </body>
- </html>