要放到 request或者session中
方法1:request.setAttribute("a",a); //推荐此方法
方法2:session.setAttribute("a",a); //该方法一般用于存储用户的登录信息
页面上就是 ${a}
action里面的值在jsp页面可以这么用el表达式获取:
action代码:
public void doPost(HttpServletRequest request , HttpServletResponse response) throws ServletException, IOException
{
request.setCharacterEncoding("UTF-8");
Map
for(String name : m.keySet())
{
System.out.println(name + ":" + m.get(name)[0]) ;
request.getSession().setAttribute(name, m.get(name)[0]);
}
request.getRequestDispatcher("theEnd.jsp").forward(request, response);
}
jsp页面取值方式:
${name}=${sessionScope[name]}