📄 poll_0005fdeal_0002ejsp_jsp.java
字号:
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
public class poll_0005fdeal_0002ejsp_jsp extends HttpJspBase {
// begin [file="/poll_deal.jsp";from=(1,0);to=(1,60)]
// end
// begin [file="/poll_deal.jsp";from=(2,0);to=(2,58)]
// end
static {
}
public poll_0005fdeal_0002ejsp_jsp( ) {
}
private static boolean _jspx_inited = false;
public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
String _value = null;
try {
if (_jspx_inited == false) {
synchronized (this) {
if (_jspx_inited == false) {
_jspx_init();
_jspx_inited = true;
}
}
}
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=gb2312");
pageContext = _jspxFactory.getPageContext(this, request, response,
"", true, 8192, true);
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
// HTML // begin [file="/poll_deal.jsp";from=(0,100);to=(1,0)]
out.write("\r\n");
// end
// begin [file="/poll_deal.jsp";from=(1,0);to=(1,60)]
beans.connDB connDB = null;
boolean _jspx_specialconnDB = false;
synchronized (pageContext) {
connDB= (beans.connDB)
pageContext.getAttribute("connDB",PageContext.PAGE_SCOPE);
if ( connDB == null ) {
_jspx_specialconnDB = true;
try {
connDB = (beans.connDB) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "beans.connDB");
} catch (ClassNotFoundException exc) {
throw new InstantiationException(exc.getMessage());
} catch (Exception exc) {
throw new ServletException (" Cannot create bean of class "+"beans.connDB", exc);
}
pageContext.setAttribute("connDB", connDB, PageContext.PAGE_SCOPE);
}
}
if(_jspx_specialconnDB == true) {
// end
// begin [file="/poll_deal.jsp";from=(1,0);to=(1,60)]
}
// end
// HTML // begin [file="/poll_deal.jsp";from=(1,60);to=(2,0)]
out.write("\r\n");
// end
// begin [file="/poll_deal.jsp";from=(2,0);to=(2,58)]
beans.chStr chStr = null;
boolean _jspx_specialchStr = false;
synchronized (pageContext) {
chStr= (beans.chStr)
pageContext.getAttribute("chStr",PageContext.PAGE_SCOPE);
if ( chStr == null ) {
_jspx_specialchStr = true;
try {
chStr = (beans.chStr) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "beans.chStr");
} catch (ClassNotFoundException exc) {
throw new InstantiationException(exc.getMessage());
} catch (Exception exc) {
throw new ServletException (" Cannot create bean of class "+"beans.chStr", exc);
}
pageContext.setAttribute("chStr", chStr, PageContext.PAGE_SCOPE);
}
}
if(_jspx_specialchStr == true) {
// end
// begin [file="/poll_deal.jsp";from=(2,0);to=(2,58)]
}
// end
// HTML // begin [file="/poll_deal.jsp";from=(2,58);to=(3,0)]
out.write("\r\n");
// end
// begin [file="/poll_deal.jsp";from=(3,2);to=(18,0)]
if(session.getAttribute("poll")==null){
if (!request.getParameter("optionname").equals("")){
String opt=chStr.chStr(request.getParameter("optionname"));
int temp=connDB.executeUpdate("update tb_poll set poll=poll+1 where optionName='"+opt+"'");
if (temp==0){
out.println("<script language='javascript'>alert('投票失败!');window.location.href='index.jsp';</script>");
}else{
out.println("<script language='javascript'>alert('投票成功!');window.location.href='poll_result.jsp';</script>");
session.setAttribute("poll","ok");
}
}
}else{
out.println("<script language='javascript'>alert('您已经投过票了!');window.location.href='poll_result.jsp';</script>");
}
// end
// HTML // begin [file="/poll_deal.jsp";from=(18,2);to=(20,0)]
out.write("\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
// end
} catch (Throwable t) {
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (pageContext != null) pageContext.handlePageException(t);
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -