Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

pageContext in custom tag

 
DeepakN kumar
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can someone please help me with the working of pageContext.getOut().print()?

Suppose i use many custom tag in my jsp and in each custom tag if i use pageContext.getOut().print(), then will the print() send the output to the browser each time? or it is written to the broswer only once?
 
Stefan Evans
Bartender
Posts: 1691
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "out" here is the current JspWriter stream being used for client response.
Writing to it writes to the response buffer.

The output will be sent to the browser when
- the jsp/servlet finishes being processed
- the buffer is full
- the buffer is flushed manually.

So all of your print statements will be reflected in the response output.
The response is normally sent to the browser in a single chunk.

So if I understand the question correctly, that would make it your second guess: it is written to the browser only one.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic