• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

question on standard action

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
which of the following statements are about jsp:forward action is false?


a)if the page out put is buffered,the buffer is cleared prior to forwarding.

b) if the page out put is buffered and the buffer was flushed, the buffer is reset once again before forwarding.

c) if the page output was un buffered and anything has been written to it ,an attempt to forward the request will result in an

IllegalStateException.

the answer what i expected was c.

and the answer what they had given is b.


how is it possible what happens about the third example. Any one explain this please.
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Option b is correct. The question ask about what is not true. If the buffered is already flush, the forward action throws IllegalStateException.

Thanks
 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
According to me 1 option shuld be correct.

Reson:before forwarding the response buffer is always cleared (but if the response is already commited to the client then forward does not take place giving error as"Resonse has already been commited.")
This makes option 1 as correct.
Since flushing is there in option 2 (it is incoorect forward can not happen)

Option 3:i am not sure about this ....

Correct me if am wrong

-santosh

SCJP1.4(96%)
SCWCD -in progress
 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Need clarification on Option C.

When they say that the output is unbuffered, anything written to the response will be sent to client then and there. am I right?

So, when something is written to the client the response is said to be committed. In such a case, forward will result in IllegalStateException. So, "c" is true.

Can someone confirm me on this!

Regards,
Mani
 
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For me the option "b" and "c" have the same meaning.


b)"buffer was flushed"

c)"anything has been written to it" --> committed/flushed


The only one difference is about the propertly effect for that.
I mean,

- Has the buffer already been "committed/flushed/written" ?
- so EXCEPTION instead of RESETING it.

Does it make sense?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic