• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RequestDispatcher forward doubt

 
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The execution control returns to the resource that has called the forward() method after the callee resource finishes processing.

true or false

Please help!

thanks,
 
Ranch Hand
Posts: 558
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, chandra.

Thats true.
I too don't know.. earlier but I saw here in some post discussing about that.


*** Note
There is difference betwwen the RequestDispatcher forward call and jsp:forward
jsp:forward never returns.
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Srini,

There were contradiction between asked question and its description in
the mock exam question.

I got the clear idea after referring to some other sources and observing
it practically:

1- In case of include() control returns back to the caller
2- In case of forward() control is just delegated to the called source.
Observations:
Before the forward() is done, buffer is cleared.
If the response is already been committed, forward() gives
IllegalStateException.

Therefore I find the above statement (my question) false.

What do you say?

Thanks,
 
Srinivasan thoyyeti
Ranch Hand
Posts: 558
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Chandra,

You are just reading the question and skipping the intent.

see the question carefully now...

The execution control returns to the resource that has called the forward() method after the callee resource finishes processing.


meditate.
I am going read the question carefully.
I am going read the question carefully.

 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Srinivasan,

Just have a look at the description that is provided advocating the
correctness of that option:

The execution control returns to the resource that has called the forward() method after the callee resource finishes processing.




[Description:]
RequestDispatcher.forward() is also a normal method call, so the control does return to the calling resource.


Isn't it contradicting?

Thanks,
[ August 12, 2007: Message edited by: Chandra Bhatt ]
 
Srinivasan thoyyeti
Ranch Hand
Posts: 558
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Chandra,

I would be pleased if you come up with method call that never returns.
 
CAUTION! Do not touch the blades on your neck propeller while they are active. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic