请问一个关于out.println()的执行顺序的问题!

jbas jbas 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我有一个页面a.jsp,内容如下:
<jsp:useBean id="idmy" class="com.my.Ex" scope="page"/>

<html>
<body>
aaaaaaaaaa<br>
<%=idmy.pt(response,"mystr")%>
</body>
</html>

com.my.Bx中的内容为:
public class Bx
{
public static void pt(HttpServletResponse response,String str){
response.getWriter().println(str);
}
....
}

现在我把这个a.jsp页面放到resin服务器下执行,我得到的页面html代码为:
<html>
<body>
aaaaaaaaaaaaa
mystr
</body>
</html>

但是我把他放到tomat或jboss服务器下执行会是这样的:

mystr
<html>
<body>
aaaaaaaaaaaaa
</body>
</html>

我也想在tomat或jboss服务器下得到
<html>
<body>
aaaaaaaaaaaaa
mystr
</body>
</html>的效果,请问我该怎样做???我执行了response.getWriter().flush();也不行!
谢谢了!
...全文
评论 2
收藏 已收藏
分享
返回顶部
jbas
Web 开发 81,107 成员 341,720 内容