我写了一个页面,功能是根据用户是否已经登陆,来判断是否他可以回复,提示说无法编译该JSP页面,请各位大侠指点一下~谢谢
出问题的代码段:(其中的chat.jsp页面,是填写和提交回复信息的页面)
<%
String una1=null;
Cookie[] cookies1=request.getCookies();
for(int i=0;i<cookies1.length;i++){
Cookie temp=cookies1[i];
if("un".equals(temp.getName())){
una1=temp.getValue();
}
if(una1!=null){
%>
<jsp:include flush="true" page="chat.jsp?tid=<%=tid %>"></jsp:include>
<%
}else{
%>
<h5><font color="red">您尚未登陆无法发表评论。</font></h5>
<%
}
%>
出问题的代码段:(其中的chat.jsp页面,是填写和提交回复信息的页面)
<%
String una1=null;
Cookie[] cookies1=request.getCookies();
for(int i=0;i<cookies1.length;i++){
Cookie temp=cookies1[i];
if("un".equals(temp.getName())){
una1=temp.getValue();
}
if(una1!=null){
%>
<jsp:include flush="true" page="chat.jsp?tid=<%=tid %>"></jsp:include>
<%
}else{
%>
<h5><font color="red">您尚未登陆无法发表评论。</font></h5>
<%
}
%>
你的tid是在那里定义的???
tid=una1???
Cookie temp=cookies1[i];
if("un".equals(temp.getName())){
una1=temp.getValue();
}你少了一个关闭for循环的}
return;
我确实是少了一个 } 实在是太大意了
用eclipse或者netbeans之类的工具 这类问题就不太会发生了