从servlet java文件中传递参数给JSP页面文件

Posted by 唐传林 on June 17, 2019

发送端(servlet java文件):

1
2
3
String  a="test123";
HttpSession session=request.getSession(); 
session.setAttribute("a",a); 

接收端(JSP页面文件):

1
2
3
4
<%
	String a = (String)session.getAttribute("a");
	out.println(a);
%>

☛兄dei,请我喝杯茶☚
%