}
        }catch(Exception e){
            e.printStackTrace();
            request.setAttribute("username", username);
            request.setAttribute("operError", e.getMessage());
            request.getRequestDispatcher("/login.jsp").forward(request, response);
        }
    }
4.1.3    用户信息的修改与删除

用户信息的修改
在此模块内,用户可以对自己所发布的信息进行修改,并且可以进行重新的发布。如果有不需要的信息还可以进行删除。用户商品修改图如图4.6所示。
 
图 4.6 商品信息修改
用户修改商品核心代码:
public void doUpdateGoodsMsg(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String goodsTypeId = ServletUtil.getString(request,"goodsTypeId");
        String goodsMsgId = ServletUtil.getString(request,"goodsMsgId");
        String title = ServletUtil.getString(request, "title");
        String content = ServletUtil.getString(request, "content");
        String mobile = ServletUtil.getString(request, "mobile");
        String qq = ServletUtil.getString(request, "qq");
        //        goodsMsg.setStatus("0");
        
        PrintWriter out = response.getWriter();
        try{
            if(StringUtils.isEmpty(goodsMsgId)){
                throw new MyException("修改的记录ID不能为空");
            }
            
            if(StringUtils.isEmpty(goodsTypeId)){
                throw new MyException("分类不能为空");
            }
            
            if(StringUtils.isEmpty(title)){
                throw new MyException("标题不能为空");
            }else if(title.length()>30){
                throw new MyException("标题长度不能大于30位");
            }
            
                if(StringUtils.isEmpty(content)){
                throw new MyException("描述不能为空");
            }else if(title.length()>250){
                throw new MyException("描述长度不能大于250位");
            }
上一篇:交互式XML课程建设网站的开发
下一篇:C++手机网上营业厅系统的设计与实现

jsp+mysql网上化肥店系统的设计与开发

Android大学一卡通APP设计与开发+源代码

高校校园网信息安全隐患及防范措施

jsp+mysql网络招标评审系统设计+源代码

jsp+mysql酒店管理系统的设计+源代码

asp.net+sqlserver校园论坛开发设计

jsp+mysql网上书城的设计与实现+ER图

AES算法GPU协处理下分组加...

提高教育质量,构建大學生...

STC89C52单片机NRF24L01的无线病房呼叫系统设计

浅谈高校行政管理人员的...

上海居民的社会参与研究

基于Joomla平台的计算机学院网站设计与开发

酵母菌发酵生产天然香料...

浅论职工思想政治工作茬...

压疮高危人群的标准化中...

从政策角度谈黑龙江對俄...