struts1 的例子????

来源:百度知道 编辑:UC知道 时间:2024/06/22 18:01:28
谁能给我一个关于struts 1 的带有增删改查的 例子 最好是用MyEclipse 开发的 数据库是SQL Server2000的 例子呀 发我邮箱吧 谢谢 了 312534210@qq.com

继承DispatchAction类即可在Action中自定义方法

//parentlist页面
public ActionForward list(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception{
//权限检查
if(!UserDao.checkRight((String)request.getSession().getAttribute("User"),"故障管理",request))
{
request.setAttribute("message","您无权使用该功能!");
return mapping.findForward("rightlimited");

}
MalfunctionActionForm newform = (MalfunctionActionForm)form;

//引入地域
String areaid = (String)request.getSession().getAttribute("Areaid");
String areaids = AreaId.getAreaIds(areaid);

//引入条件处理
String type = request.getParameter("type");
if(type==null||"".equals(type)){
type = newform.getSelecttype();
if(type==null||"".equals(type)){
type = "0";<