src/com/action/toushu_servlet.java

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

package com.action;

import java.io.IOException;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.text.SimpleDateFormat;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.directwebremoting.WebContext;
import org.directwebremoting.WebContextFactory;

import com.dao.DB;
import com.orm.TAdmin;
import com.orm.Ttoushu;
import com.orm.Tyezhu;

public class toushu_servlet extends HttpServlet
{
	public void service(HttpServletRequest req,HttpServletResponse res)throws ServletException, IOException 
	{
        String type=req.getParameter("type");
        
		if(type.endsWith("toushuAdd"))
		{
			toushuAdd(req, res);
		}
		if(type.endsWith("toushuQuery"))
		{
			toushuQuery(req, res);
		}
		if(type.endsWith("toushuMana"))
		{
			toushuMana(req, res);
		}
	}
	public void toushuAdd(HttpServletRequest req,HttpServletResponse res)
	{
		HttpSession session=req.getSession();
        Tyezhu yezhu=(Tyezhu)session.getAttribute("yezhu");
        int yezhuID=yezhu.getId();
		String toushuwenti=req.getParameter("toushuwenti");
		String toushushijian=new SimpleDateFormat("yyyy-MM-dd").format(new Date());
		String sql="insert into toushu(toushuwenti,toushushijian,yezhuID) values(?,?,?)";
		Object[] params={toushuwenti,toushushijian,yezhuID};
		DB mydb=new DB();
		mydb.doPstm(sql, params);
		mydb.closed();
		req.setAttribute("message", "投诉成功");
		req.setAttribute("path", "toushu?type=toushuQuery");
		
        String targetURL = "/common/success.jsp";
后面还有 92 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。