📄 billaction.java
字号:
/*
* Created on 2006-4-27
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package cn.com.tym.blank.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
import cn.com.tym.admin.AdminLogin;
import cn.com.tym.pub.ConnPool;
import cn.com.tym.pub.DB;
import cn.com.tym.util.tablebean.*;
import cn.com.tym.blank.form.*;
/**
* @author jack_booth
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class BillAction extends DispatchAction{
// ���ù��
public ActionForward bill(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response){
if (AdminLogin.isLogin(request) == 0) {
return mapping.findForward("admin");
}
// ActionErrors errors=new ActionMessages();
String PageForward="billPage";
BillForm frm =(BillForm)form;
UtilBill util=new UtilBill();
try{
ConnPool pool=new ConnPool();
DataSource dataSource=pool.Tomcat_JDBC_DataSource();
DB db = new DB(dataSource);
boolean bool= util.setBill(frm.getBillTitle(),frm.getUrlPath(),frm.getUrlPhoto(),frm.getPhotohight(),frm.getPhotoweight(),db);
if(bool){
// errors.add("success",new ActionMessage("errors.adminSuccess"));
// saveErrors(request,errors);
}
else{
// errors.add("ddd",new ActionMessage("errors.adminDel"));
// saveErrors(request,errors);
System.out.println("ʧ��");
}
} catch(Exception e){
e.printStackTrace();
PageForward="errors";
}
return mapping.findForward(PageForward);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -