怎样将后台传过来的html标签原样显示

解决方案 »

  1.   

    out.println("<html> <font color=red>hellow</font></html>");
      

  2.   

    String htmlStream = "<font color=\"red\">color red</font>";
    htmlStream = htmlStream.replaceAll("<","&lt;").replaceAll(">","&gt;");
    out.println(htmlString)
      

  3.   

    不行啊,我的意思是将我后台传过来的html代码,原样显示到页面上比如:<STRONG>sadadsadssada</STRONG>
    那页面上sadadsadssada就是加粗的效果
      

  4.   

    servlet里?
    response.getWriter().print("<STRONG>sadadsadssada</STRONG>");
      

  5.   


    你是想要页面上显示<STRONG>sadadsadssada</STRONG>,这样的话你需要将尖括号转义
    还是显示sadadsadssada的加粗的效果
      

  6.   

    response.Writer("<html> <font color=red>hellow</font></html>");