Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
CancelRecommendNews.java
Package: 55593402pressRelease.rar [view]
Upload User: junmaots
Upload Date: 2022-07-09
Package Size: 2450k
Code Size: 2k
Category:
Jsp/Servlet
Development Platform:
Java
- /*
- * Created on 2005-12-10
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
- package com.mycompany.servlet;
- import java.io.IOException;
- import java.net.URLEncoder;
- import java.text.ParseException;
- import java.text.SimpleDateFormat;
- import java.util.Date;
- import javax.servlet.ServletConfig;
- import javax.servlet.ServletException;
- import javax.servlet.http.HttpServlet;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
- import com.jspsmart.upload.Request;
- import com.jspsmart.upload.SmartUpload;
- import com.jspsmart.upload.SmartUploadException;
- import com.mycompany.news.dto.News;
- import com.mycompany.news.service.NewsService;
- /**
- * @author Administrator
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
- public class CancelRecommendNews extends HttpServlet {
- private ServletConfig config;
- public void init(ServletConfig arg0) throws ServletException {
- config = arg0;
- }
- protected void service(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- NewsService nservice = new NewsService();
- long newsid =Long.parseLong(request.getParameter("newsid"));
- boolean result;
- try {
- result = nservice.cancelRecommendNews(newsid);
- if(result)
- response.sendRedirect(request.getContextPath()+"/opsucc.jsp?message="+URLEncoder.encode(nservice.getMessage(),"GB2312"));
- else
- response.sendRedirect(request.getContextPath()+"/opfail.jsp?message="+URLEncoder.encode(nservice.getMessage(),"GB2312"));
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- response.sendRedirect(request.getContextPath()+"/opfail.jsp?message="+e.getMessage());
- }
- }
- }