⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addliuyanservlet.java

📁 个人博客系统
💻 JAVA
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   AddLiuyanServlet.java

package zxwblog.servlet;

import java.io.IOException;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import zxwblog.beans.AddMessage;

public class AddLiuyanServlet extends HttpServlet
{

	private static final String CONTENT_TYPE = "text/html; charset=GBK";

	public AddLiuyanServlet()
	{
	}

	public void init()
		throws ServletException
	{
	}

	public void doGet(HttpServletRequest request, HttpServletResponse response)
		throws ServletException, IOException
	{
		response.setContentType("text/html; charset=GBK");
		HttpSession session = request.getSession();
		ServletContext app = getServletContext();
		String path = app.getRealPath("database/db1.mdb");
		AddMessage am = new AddMessage();
		am.setNc(request.getParameter("nc"));
		am.setIp(request.getParameter("ip"));
		am.setSex(request.getParameter("sex"));
		am.setTitle(request.getParameter("title"));
		am.setHead(request.getParameter("head"));
		am.setContent(request.getParameter("content"));
		am.setPath(path);
		String checkCode = request.getParameter("checkCode");
		if (checkCode == null)
			checkCode = "";
		String rand = (String)session.getAttribute("rand");
		if (rand == null)
			rand = "";
		if (rand.equals(checkCode))
		{
			am.add();
			String f = am.getFlag();
			if (f.equals("addtrue"))
			{
				session.setAttribute("addLiuyan", f);
				response.sendRedirect("liuyan.jsp");
			} else
			if (f.equals("addfalse"))
			{
				session.setAttribute("addLiuyan", f);
				response.sendRedirect("liuyan.jsp");
			}
		} else
		{
			session.setAttribute("addLiuyan", "ckWrong");
			response.sendRedirect("liuyan.jsp");
		}
		am.closeAll();
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
		throws ServletException, IOException
	{
		doGet(request, response);
	}

	public void destroy()
	{
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -