post.java
上传用户:manager48
上传日期:2022-07-31
资源大小:997k
文件大小:2k
- /*****************************************************************
- * Date:2007-05-10 *
- * File:post.java *
- * Author:jezz *
- *****************************************************************/
- package wm.servlet;
- import java.util.*;
- import java.sql.*;
- import java.io.*;
- import javax.servlet.*;
- import javax.servlet.http.*;
- import wm.bean.messFun;
- public class post extends HttpServlet{
- public void init() throws ServletException
- {
- }
- public void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException
- {
- messFun MF=new messFun();
- String id="";
- String content_reply="";
- String msg="";
- if(request.getParameter("id")!=null)
- id=request.getParameter("id");
- else
- msg+="<li>ID不存在</li>";
- if(request.getParameter("content_reply")!="")
- content_reply=request.getParameter("content_reply");
- else
- msg+="<li>内容不能为空</li>";
- if(msg.equals(""))
- {
- boolean result=MF.postMess(id,content_reply);
- if(result==true)
- msg+="<li>回复成功</li>";
- else
- msg+="<li>回复失败</li>";
- request.setAttribute("msg",msg);
- RequestDispatcher wm =request.getRequestDispatcher("common.jsp");
- wm.forward(request,response);
- }
- else
- {
- request.setAttribute("msg",msg);
- RequestDispatcher wm =request.getRequestDispatcher("common.jsp");
- wm.forward(request,response);
- }
- }
- public void doPost(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException
- {
- doGet(request,response);
- }
- public void destroy()
- {
- }
- }