代码如下:String msg = "";
msg= ""+"<entry><ref href=\"";
msg += local.substring(0,local.lastIndexOf("/"))+url0;
msg += "\"/></entry>\n";
String msghead="<asx version=\"3\">\n<title>JSPBOOK</title>\n<repeat>\n";
String msgtail="</repeat>\n</asx>";
msg=new StringBuffer(msghead).append(msg).append(msgtail).toString();然后用out.print(msg);out.flush();
但是什么也打不出来,这是为什么啊?

解决方案 »

  1.   

    你local是什么呢,如果不行的话你就单独写一个Test,在main()里打出来看看。
      

  2.   

    local是绝对路径,能打出来,没问题,但是msg就是打不出来
      

  3.   

    不知道楼主用的是JSP还是servlet
    好像JSP不用out.close();
    out.flush();
      

  4.   


    String msg="";
    msg=""+"<entry><ref href=\\";
    msg+=local.substring(0,local.lastIndexOf("/"))+url0;
    msg+="\\/></entry>\n";这样呢??
      

  5.   

    最好先试下System.out.println(msg);看控制台有值输出不
      

  6.   


    控制台?我这是jsp文件,也有控制台吗?我用out.print输出了,没有值
      

  7.   

    我帮他试验了一下,是可以打印的
    <asx version="3">
    <title>JSPBOOK</title>
    <repeat>
    <entry><ref href=""/></entry>
    </repeat>
    </asx>
    我把local去掉了,是的,在jsp中是不显示的,这代码是不是有特殊含义啊!
      

  8.   

    jsp中也可以在控制台输出信息的