<%!
static HashMap msgs=new HashMap();static
{
  String t="增加成功。<a href='asf?'"+new_account_id+">aa</a>";
  msgs.put("add", t);
}
%>

解决方案 »

  1.   

    msgs.put("add", "增加成功。<a href=asf.jsp?UsrID=" + new_account_id + ">aa</a>");
      

  2.   

    你的HashMap每次都被重新初始化记数可以用COOKIES保存
      

  3.   

    我是通过get方式传到jsp的,我给msgs定制了一些错误id,我想把传过来的new_account_id加到连接里,我该怎么做呢
      

  4.   

    <% 
        new_account_id = request.getParameter("new_account_id") 
    %><%!
        static HashMap msgs=new HashMap();
        String new_account_id = "";    static {
            msgs.put("add", "增加成功。<a href='asf?'"+new_account_id+">aa</a>");
        }
    %>