Does spring mvc have response.write to output to the browser directly?

前端 未结 4 782
盖世英雄少女心
盖世英雄少女心 2020-12-08 09:01

I am using spring mvc with freetemplate.

In asp.net, you can write straight to the browser using Response.Write(\"hello, world\");

Can you do this in spring

4条回答
  •  盖世英雄少女心
    2020-12-08 09:17

    If you want to send something to OutputStream, even if you are using Freemaker, just use @ResponseBody

    example:

        @RequestMapping(value = "report1", method = RequestMethod.GET, produces = "application/pdf")
        @ResponseBody
        public void getReport1(OutputStream out) {
    

提交回复
热议问题