81,091
社区成员
发帖
与我相关
我的任务
分享
<c:if test="${requestScope.classss==null}">
<jsp:forward page="servlet/TypeServlet"></jsp:forward>
</c:if>
<c:if test="${requestScope.types!=null}">
Hello World!
</c:if>
List listTypes=new TypeBizImpl().getTypesByClassId(1);
request.setAttribute("types", listTypes);
RequestDispatcher rd=request.getRequestDispatcher("../index.jsp");
rd.forward(request, response);
List listTypes=new TypeBizImpl().getTypesByClassId(1);
if(listTypes!=null)
{
request.setAttribute("types", listTypes);
RequestDispatcher rd=request.getRequestDispatcher("../index.jsp");
rd.forward(request, response);
}
else
{
int count =1;
request.setAttribute("types", count);
RequestDispatcher rd=request.getRequestDispatcher("../index.jsp");
rd.forward(request, response);
}
楼主看看这个吧 。
request.setAttribute("types", listTypes);
<c:if test="${requestScope.types==null}">
<jsp:forward page="servlet/TypeServlet"></jsp:forward>
</c:if>
<c:if test="${requestScope.types!=null}">
Hello World!
</c:if>