java - 传递值 但是不跳转,具体看下面代码:
ringa_lee
ringa_lee 2017-04-18 09:23:13
0
2
495

A.servlet里面有

String a=request.getParameter("a");
String b=request.getParameter("b");
String c=request.getParameter("c");
最后A.servlet转发到一个b.jsp页面了
b.jsp页面提交到B.servlet
B.servlet需拿到A.servlet里面的 a,b,c 这三个参数查询数据库,怎么拿到这三个参数。
a,b,c 这三个参数 不是数据库的信息 所以不能从数据库查出来转到b.jsp在提交到B.servlet

ringa_lee
ringa_lee

ringa_lee

reply all(2)
阿神

A servlet:
setParameter("a");

b.jsp:
name="a"

B servlet:
getParameter("a")

阿神

I think you should
request.setAttribute("a",a);
request.setAttribute("b",b);
request.setAttribute("c",c);
Forward to b.jsp, use EL Tag {request.attribute("a")} (it seems to be written like this),
After submission, according to the name attribute of your form, go to getParameter("name attribute") in b.servlet.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!