Package com.tubeonfire.ajax.admin

Source Code of com.tubeonfire.ajax.admin.ProcessAdvertising

package com.tubeonfire.ajax.admin;

import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.tubeonfire.entity.Advertising;
import com.tubeonfire.model.admin.AdvertisingModel;

@SuppressWarnings("serial")
public class ProcessAdvertising extends HttpServlet {
  public void doGet(HttpServletRequest request, HttpServletResponse response)
      throws IOException {
    HttpSession session = request.getSession();
    String action = request.getParameter("action");
    if (action != null && action.equals("delete")) {
      String id = request.getParameter("id");
      Advertising obj = AdvertisingModel.byId(id, false);
      if (obj != null) {
        session.setAttribute("success", "Action success !");
        AdvertisingModel.delete(obj);
      }

    }
  }
}
TOP

Related Classes of com.tubeonfire.ajax.admin.ProcessAdvertising

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.