本文发表在 rolia.net 枫下论坛import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class download extends HttpServlet{
public void doPost(HttpServletRequest request,HttpServletResponse response)
throws ServletException,IOException {
request.setAttribute("download", "Y");
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/_ScriptLibrary/function.jsp");
dispatcher.include(request,response);
if (request.getAttribute("status") != null) {
response.sendRedirect(request.getAttribute("status").toString());
return;
}
int LIMIT = Integer.parseInt(getServletContext().getInitParameter("numSongs"));
String STATUS = getServletContext().getInitParameter("ftpDisabled");
//getting form vbl titleid.
String TITLEID = request.getParameter("TITLEID");
int DOWNLOAD = Integer.parseInt(request.getParameter("DOWNLOAD"));
if (STATUS.equals("Y")) {
printErr(response,LIMIT);
return;
}
updateSQL(TITLEID, DOWNLOAD);
if (updateCookies(request,response,LIMIT)) {
gotoPage(TITLEID, request, response);
}
}更多精彩文章及讨论,请光临枫下论坛 rolia.net
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class download extends HttpServlet{
public void doPost(HttpServletRequest request,HttpServletResponse response)
throws ServletException,IOException {
request.setAttribute("download", "Y");
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/_ScriptLibrary/function.jsp");
dispatcher.include(request,response);
if (request.getAttribute("status") != null) {
response.sendRedirect(request.getAttribute("status").toString());
return;
}
int LIMIT = Integer.parseInt(getServletContext().getInitParameter("numSongs"));
String STATUS = getServletContext().getInitParameter("ftpDisabled");
//getting form vbl titleid.
String TITLEID = request.getParameter("TITLEID");
int DOWNLOAD = Integer.parseInt(request.getParameter("DOWNLOAD"));
if (STATUS.equals("Y")) {
printErr(response,LIMIT);
return;
}
updateSQL(TITLEID, DOWNLOAD);
if (updateCookies(request,response,LIMIT)) {
gotoPage(TITLEID, request, response);
}
}更多精彩文章及讨论,请光临枫下论坛 rolia.net