如何将文本框中的东西保存下来 即使页面跳转到其他的页面 再跳转回来的时候文本框中的内容还在?

解决方案 »

  1.   


    <input type="text" value="保存的内容"/>
      

  2.   

    !session.setAttribute();----》到另外一个页面得到session.getAttribute();
    好像request.setAttribute也可以的吧?
      

  3.   

    你可以用一个参数一直传下去
    a.jsp:
    <form action="ff.jsp">
    <input type="text" name="a" value="<%=request.getParameter("a")==null?"":request.getParameter("a")%>">
    </form>ff.jsp:
    <form action="t.jsp?a=<%=request.getParameter("a")%>">
    </form>t.jsp:
    <a href="a.jsp?a=<%=request.getParameter("a")%>返回a.jsp</a>
      

  4.   

    文本框, 如果内容多,还是保存到session里面吧。小A的方法适合于数据少的情况。
      

  5.   

    使用session.setAttribute( 随便设置一个变量,你要用的变量值);将内容保存在session中去,
    只要不关闭浏览器,这个值就会一直在.想使用用时,或者想显示时,到另外一个页面得到session.getAttribute(你设置的变量值); 
      

  6.   

    可以保存在ActionForm中(struts in action 书中有详细例子)也可以保存在cookie中或session中
      

  7.   

    <HTML>
    <HEAD>
    <META NAME="save" CONTENT="history">
    <STYLE>
      .saveHistory {behavior:url(#default#savehistory);}
    </STYLE>
    </HEAD>
    <BODY>
    <INPUT class=saveHistory type=text id=oPersistInput>
    <input type=button onclick='javascript:location.href="http://heisetoufa.ggblog.com/"' value='点击进入,再按后退键试试?'>
    </BODY>
    </HTML>
      

  8.   

    页面跳转时放在session里,在跳回来的时候从session中取出来。