我的处理jsp代码如下:
<%@ page contentType= "text/html; charset=gb2312 " language= "java " errorPage= " " %>
<%@ page import= "com.polytech.sksh.logic.MessageManager " %>
<%@ page import= "com.polytech.sksh.util.DateTimeUtil " %>
<%@ page import= "java.util.List " %>
<%@ page import= "com.polytech.sksh.dto.Users " %>
<jsp:useBean id= "user " scope= "session " class= "com.polytech.sksh.dto.Users "/>
<%
boolean had = MessageManager.checkWorkPlanAudit(user);
if (had){
out.print( "true ");
}else{
out.print( "false ");
}
%>
我希望返回“true”或者“false”,可是实际上之前多了很多空行。。。难道跟上面的import有关系?
------解决方案--------------------
jsp页面中每一个回车换行都会产生一个空行
在你要输出你想要的内容之前调用out.clear();就可解决