*
The moose likes JSP and the fly likes pageContext in custom tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "pageContext in custom tag" Watch "pageContext in custom tag" New topic
Author

pageContext in custom tag

DeepakN kumar
Greenhorn

Joined: Apr 14, 2012
Posts: 27
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

Joined: Jul 06, 2005
Posts: 1016
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: pageContext in custom tag
 
Similar Threads
Custom Display Regulator Tag and Interface
HTML Writer for a web project.
what happens when doStartTag returns EVAL_BODY_BUFFERED?
Can anyone explain this to me?
doInitBody() method in Tag Handlers.