📄 editarticle.java
字号:
package com.doone.fj1w.fjmgr.config;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.doone.fj1w.fjmgr.sysmgr.Util;
import com.doone.util.FileLogger;
/**
* Created by IntelliJ IDEA. User: lizhx Date: 2005-7-15 Time: 14:32:16
* Email:lizx@doone.com.cn
*/
public class EditArticle extends HttpServlet {
static final private String CONTENT_TYPE = "text/html; charset=GBK";
public void init() throws ServletException {
}
public void doGet(HttpServletRequest httpRequest,
HttpServletResponse httpResponse) throws ServletException,
IOException {
httpRequest.setCharacterEncoding("GBK");
httpResponse.setContentType(CONTENT_TYPE);
PrintWriter out = httpResponse.getWriter();
try {
String articleId = httpRequest.getParameter("articleId").trim();
ArticleBean ab = new ArticleBean();
String state = httpRequest.getParameter("state").trim();
String content = httpRequest.getParameter("content").trim();
String addOk = "";
articleId = Util.Replace(articleId);
state = Util.Replace(state);
ab.setState(state);
ab.setContent(content);
addOk = ab.UpdateArticle(articleId);
if(addOk.equals("1"))
out.write("<script language=javascript>window.location.href='"+httpRequest.getContextPath()+"/view/sysmgr/OperSuccess.jsp';</script>");
else
out.write("<script language=javascript>window.location.href='"+httpRequest.getContextPath()+"/view/sysmgr/OperFailure.jsp?error=数据库操作失败';</script>");
} catch (RuntimeException e) {
FileLogger.getLogger().error(e);
out.write("<script language=javascript>window.location.href='"+httpRequest.getContextPath()+"/view/sysmgr/OperFailure.jsp?error="
+ Util.Replace(e.getMessage()) + "';</script>");
} catch (Exception e) {
FileLogger.getLogger().error(e);
out.write("<script language=javascript>window.location.href='"+httpRequest.getContextPath()+"/view/sysmgr/OperFailure.jsp';</script>");
}
}
public void doPost(HttpServletRequest httpRequest,
HttpServletResponse httpResponse) throws ServletException,
IOException {
doGet(httpRequest, httpResponse);
}
// Clean up resources
public void destroy() {
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -