日期:2014-05-16  浏览次数:20947 次

jstl应用

问题我已经在注释中写好,帮我看看。




<BODY>

<%
String str = request.getParameter("userName")==null?"":request.getParameter("userName");
if (str.equals("")) {
response.sendRedirect("exampleJstl_2.jsp?message=pls input data!");
} else {
out.print("以下是<font color=red size=16>"+str+"</font>用户的基本信息。。。。");
}
%>
<p>
<c:if test="empty ${param.userName}">
<c:set var="str" value="" scope="page"/>
</c:if>
<c:if test="${param.userName}!=null">
<c:set var="str" scope="page">
${param.userName}
</c:set>
</c:if>
<!-- 这个判断不知道为什么报错,报错的内容是: 
org.apache.jasper.JasperException: /exampleJstl_2R.jsp(24,37) Unterminated &lt;c:if tag
是否不能这样写呢?-->
<c:if test="${pageScope.str}.euqals("")">
<c:redirect url="exampleJstl_2.jsp"/>
</c:if>

<c:out value="以下是<font color=red size=16>${pageScope.str}</font>用户的基本信息。。。。"/>

</BODY>
------解决方案--------------------
看来这个帖子要沉了