标签:java
ItemManager itemManager=new ItemManagerImpl(); try{ itemManager.addItem(item); }catch(ApplicationException e){ String error_message="添加物料失败,物料代码"; } //重定向到查询页面 response.sendRedirect(request.getContextPath()+"/basedata/item_maint.jsp?errorMessage="+URLEncoder.encode(errorMessage,"GB18030"));
<font color="red"><%=request.getParameter("error_message")==null? "": request.getParameter("error_message")%></font>
ItemManager itemManager=new ItemManagerImpl(); try{ itemManager.addItem(item); }catch(ApplicationException e){ //将参数设置到request的属性中 request.setAttribute("error_message", "添加物料失败,物料代码"); } //转发到jsp页面 request.getRequestDispatcher("/basedata/item_maint.jsp").forward(request, response);
<font color="red"><%=request.getAttribute("error_message") %></font>
标签:java
原文地址:http://blog.csdn.net/u010927139/article/details/46468371