auditguestinfo.java
来自「留言簿架构 oracle 9i + jsp + struts 留言」· Java 代码 · 共 75 行
JAVA
75 行
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.guestbook.action.admin;
import java.sql.CallableStatement;
import java.sql.Connection;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.guestbook.sys.DataBaseConnection;
/**
* MyEclipse Struts
* Creation date: 09-23-2007
*
* XDoclet definition:
* @struts.action validate="true"
* @struts.action-forward name="/admin/index" path="/admin/index.do" redirect="true"
*/
public class AuditGuestInfo extends Action {
/*
* Generated Methods
*/
/**
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
if( request.getSession().getAttribute( "loginSuccess" ) == null )
{
return mapping.findForward( "notLogin" );
}
int id=0;
try
{
id=Integer.parseInt(request.getParameter("id"));
}catch(Exception ex){}
auditing(id);
return mapping.findForward("/admin/index");
}
private static Log logger =LogFactory.getLog(AuditGuestInfo.class);
private boolean auditing(int id){
try{
Connection con=DataBaseConnection.getConnection();
CallableStatement stmt=con.prepareCall("{call pkg_guestadmin.p_a_guestinfo(?)}");
stmt.setInt(1, id);
stmt.execute();
stmt.close();
con.close();
return true;
}catch(Exception ex){
logger.error("Auditing Error!");
logger.error(ex.getMessage());
}
return false;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?