-
大小: 18.21MB文件類型: .zip金幣: 1下載: 0 次發(fā)布日期: 2023-08-02
- 語(yǔ)言: Java
- 標(biāo)簽:
資源簡(jiǎn)介
使用的工具為:
數(shù)據(jù)庫(kù)為mysql,服務(wù)器為tomcat
步驟如下:
1、把*.zip的文件包解壓
2、從eclipse中導(dǎo)入,解壓好的文件,建立的是一個(gè)WEB工程
3、導(dǎo)入工程下/WebRoot/WEB-INF/lib下的所有jar包
4、在mysql導(dǎo)入release文件下建表腳本的sql語(yǔ)句(為了防止亂碼,建議使用QuantumDB插件)
5、修改hibernate.cfg.xml中的mysql數(shù)據(jù)庫(kù)的用戶名和密碼
6、部署到tomcat的服務(wù)器上運(yùn)行就可以了。
代碼片段和文件信息
package?com.tarena.pfm.action;
import?java.util.List;
import?javax.servlet.http.HttpServletRequest;
import?javax.servlet.http.HttpServletResponse;
import?javax.servlet.http.HttpSession;
import?org.apache.struts.action.ActionForm;
import?org.apache.struts.action.ActionForward;
import?org.apache.struts.action.ActionMapping;
import?org.apache.struts.actions.MappingDispatchAction;
import?com.tarena.pfm.biz.FixedAssetsBiz;
import?com.tarena.pfm.biz.ItemBiz;
import?com.tarena.pfm.biz.impl.FixedAssetsBizImpl;
import?com.tarena.pfm.biz.impl.ItemBizImpl;
import?com.tarena.pfm.entity.FixedAssets;
import?com.tarena.pfm.entity.Item;
import?com.tarena.pfm.entity.User;
import?com.tarena.pfm.form.FixedAssetForm;
import?com.tarena.pfm.form.ItemForm;
public?class?AccountAction?extends?MappingDispatchAction?{
private?ItemBiz?itemBiz?=?new?ItemBizImpl();
private?FixedAssetsBiz?fixedBiz?=?new?FixedAssetsBizImpl();
public?ActionForward?addLifeItem(ActionMapping?mapping?ActionForm?form
HttpServletRequest?request?HttpServletResponse?response)
throws?Exception?{
HttpSession?session?=?request.getSession();
ItemForm?itemForm?=?(ItemForm)?form;
Item?lifeItem?=?itemForm.getLifeItem();
lifeItem.setUser((User)?session.getAttribute(“user“));
itemBiz.addItem(lifeItem);
session.setAttribute(“message“?“添加收支項(xiàng)目成功!“);
return?mapping.findForward(“success“);
}
public?ActionForward?addDebtItem(ActionMapping?mapping?ActionForm?form
HttpServletRequest?request?HttpServletResponse?response)
throws?Exception?{
HttpSession?session?=?request.getSession();
ItemForm?itemForm?=?(ItemForm)?form;
Item?debtItem?=?itemForm.getDebtItem();
debtItem.setUser((User)?session.getAttribute(“user“));
itemBiz.addItem(debtItem);
session.setAttribute(“message“?“添加債務(wù)項(xiàng)目成功!“);
return?mapping.findForward(“success“);
}
public?ActionForward?listItems(ActionMapping?mapping?ActionForm?form
HttpServletRequest?request?HttpServletResponse?response)
throws?Exception?{
User?user?=?(User)?request.getSession().getAttribute(“user“);
List- ?items?=?itemBiz.findItemsByUserId(user.getId());
request.setAttribute(“items“?items);
return?mapping.findForward(“success“);
}
public?ActionForward?removeItem(ActionMapping?mapping?ActionForm?form
HttpServletRequest?request?HttpServletResponse?response)
throws?Exception?{
Integer?itemId?=?Integer.valueOf(request.getParameter(“itemId“));
boolean?flag?=?itemBiz.removeItemById(itemId);
if?(!flag)?{
request.getSession().setAttribute(“message“?“該項(xiàng)目已經(jīng)被賬目所使用不能被刪除!“);
return?mapping.findForward(“fail“);
}
return?mapping.findForward(“success“);
}
public?ActionForward?addFixedAsset(ActionMapping?mapping?ActionForm?form
HttpServletRequest?request?HttpServletResponse?response)
throws?Exception?{
HttpSession?session?=?request.getSession();
FixedAssetForm?faForm?=?(FixedAssetForm)?form;
FixedAss
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2009-04-15?15:50??financing\
?????文件????????1803??2009-04-15?15:32??financing\.classpath
?????目錄???????????0??2009-04-15?15:28??financing\.myeclipse\
?????文件?????????300??2009-04-15?15:28??financing\.myme
?????文件????????1227??2009-04-15?15:33??financing\.project
?????目錄???????????0??2009-04-15?15:32??financing\.settings\
?????文件??????????88??2009-04-15?15:32??financing\.settings\org.eclipse.core.resources.prefs
?????文件?????????330??2009-04-15?15:28??financing\.settings\org.eclipse.jdt.core.prefs
?????目錄???????????0??2009-04-15?16:13??financing\release\
?????文件????13692274??2009-04-15?16:13??financing\release\financing.war
?????目錄???????????0??2009-04-15?15:56??financing\release\建表腳本\
?????文件????????1016??2009-04-15?16:17??financing\release\建表腳本\create.sql
?????文件??????????82??2009-04-15?16:15??financing\release\建表腳本\insert.sql
?????目錄???????????0??2009-04-15?16:12??financing\release\設(shè)計(jì)\
?????文件??????150528??2009-04-15?16:12??financing\release\設(shè)計(jì)\系統(tǒng)需求分析(Ver1.0.0).doc
?????目錄???????????0??2009-04-15?15:29??financing\src\
?????目錄???????????0??2009-04-15?15:29??financing\src\com\
?????目錄???????????0??2009-04-15?15:29??financing\src\com\tarena\
?????目錄???????????0??2009-04-15?15:29??financing\src\com\tarena\pfm\
?????目錄???????????0??2009-04-15?15:29??financing\src\com\tarena\pfm\action\
?????文件????????4823??2008-05-25?12:34??financing\src\com\tarena\pfm\action\AccountAction.java
?????文件????????2659??2008-05-25?10:10??financing\src\com\tarena\pfm\action\UserAction.java
?????文件????????5602??2008-05-25?16:33??financing\src\com\tarena\pfm\action\WasteBookAction.java
?????文件?????????140??2008-05-24?19:36??financing\src\com\tarena\pfm\ApplicationResource.properties
?????文件?????????235??2008-05-24?19:37??financing\src\com\tarena\pfm\ApplicationResource_zh.properties
?????目錄???????????0??2009-04-15?15:29??financing\src\com\tarena\pfm\biz\
?????文件?????????405??2008-05-20?18:18??financing\src\com\tarena\pfm\biz\FixedAssetsBiz.java
?????目錄???????????0??2009-04-15?15:29??financing\src\com\tarena\pfm\biz\impl\
?????文件????????2706??2008-05-20?18:49??financing\src\com\tarena\pfm\biz\impl\FixedAssetsBizImpl.java
?????文件????????2436??2008-05-25?11:38??financing\src\com\tarena\pfm\biz\impl\ItemBizImpl.java
?????文件????????2961??2008-05-20?18:35??financing\src\com\tarena\pfm\biz\impl\UserBizImpl.java
............此處省略192個(gè)文件信息
評(píng)論
共有 條評(píng)論