在action中,
String aa = "123";
request.setAttribute("test", aa);
然后到jsp上:
<%
    String test = (String)request.getAttribute("test");
%>