日期:2014-05-20  浏览次数:20750 次

jsp里面传值的问题
<%@taglib   uri= "http://java.sun.com/jsp/jstl/core "   prefix= "c "   %>
<%request.setParameter( "user ", "x ");
%>

<c:if   test= " <%=   request.getParameter( "user ")   !=   null%> ">
    hello,   <%=   request.getParameter( "user ")%>
</c:if>

我想输出结果是     hello,x

这样传值怎么不行,应该怎么写,谢谢

------解决方案--------------------
<%if (request.getParameter( "user ") != null)%>
hello, <%= request.getParameter( "user ")%>
------解决方案--------------------
request.setAttribute( "user ", "x ");


在 <body> 里
hello, <%=request.getAttribute( "user ") %>