• Post Reply Bookmark Topic Watch Topic
  • New Topic

Directives cannot produce output ?

 
Manikandan Jayaraman
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

In one of my J2eeCertificate questions it is mentioned that
"Directives do not produce any output into the current out stream."

Is that true? I thought include directive includes the content into the parent servlet at translation time and can add some response to the out stream.

Am I right? I hope we can produce output through this include directive.
 
Shantanu Puranik
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Directives affects the whole Page.
So the contents of the servlet that is generated out of JSP will have impact of the directives.
The role of direcive ends here.
Now producing any output is the responsibility of the generated servlet.
So the use of directive, does not produce any direct output into the current out stream.
 
Manikandan Jayaraman
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shantanu, Thanks!

For that matter even <%= Hello %> is just translated into the servlet as an out.println statement.

It is the responsibility of the servlet to produce the output. Right?

How do you differentiate the include directive with this.

I canNOT digest that directives dont directly produce output.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!