Java response content returns instead of < or > < >

I have a little problem: I'm writing to response content of the file and return it to the client as an ajax response. But there occurs html substitution: of `>` to `>` etc... What i have to do to make this substitution off ? res.setHeader( "Cache-Control", "must-revalidate, post-check=0, pre-check=0" ); res.setHeader( "Pragma", "public" ); res.setContentType( "text/html" ); TIA update // import; PostData pd = new PostData( req ); final FileData data; try { data = pd.getFileData( "sqlFile" ); ByteArrayOutputStream buf = new ByteArrayOutputStream(); for ( byte b : data.getByteData() ) { buf.write( b ); } res.getWriter().print( buf.toString() ); } i watched `buf.toString()` through debugger. it's ok there. substitution goes further. but where...
Where's the code you use to write the file contents to the response?

以上就是Java response content returns instead of < or > < >的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准