JSP提交后,如何将表单数据显示在另外一个页面上?

比如我编写了一个表单数据提交的index.html页面文件,里面有个<form name="myform" method="post" action="action.jsp">

就是将index.html里面表单数据提交到action.jsp。提交后,如何显示到另外一个页面上?就是提交后,跳转到另外一个页面,在另外一个页面里显示我所提写的表单。
action.jsp里面的代码要怎么写?请不要答非所问 .

【具体要怎么写action.jsp里面的代码?】

我今天刚学,麻烦大家把整个action.jsp里面的代码写给我。

可以用requset.getParameter("")方法来获取表单中提交的内容,比如你的index.html页面的表单中有一个姓名文本框:<input type="text" name="username"> 提交到action.jsp后,在页面中先通过写java代码取出他的值:<% String name=requset.getParameter("username") %> 然后在action.jsp的页面中输出:<input type="text" name="myname" value="<%=name%>">
温馨提示:答案为网友推荐,仅供参考
第1个回答  2015-12-07
通过form标签就可以了
<form name="frm" method=post action="result.jsp" >
<input type="text" value="" name="txt1">+<input type="text" value="" name="txt2">
<input type="submit" name="submit1">
</form>
第2个回答  2009-07-15
你的表单数据从index.html提交到action.jsp,表单里面的数据都是通过request请求过去的,你可以在action.jsp里面通过requset.getParameter("XX")获得提交过来的数据,例如在index.html的form中有个input的name为name1,值为String,那么在action.jsp中就可以用String str=requset.getParameter("name1")取得这个值. 然后在页面显示

这都不懂,回去好好学学,别什么都要别人现成的
第3个回答  2009-07-15
1、用session会话存储提交数据,显示在other.jsp
2、在action.jsp写入库后,在other.jsp读库显示

这是唯一的2个思路。
第4个回答  2009-07-15
<form name="myform" method="post" action="action.jsp" target="_blank">