File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Simple Question ??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Simple Question ???" Watch "Simple Question ???" New topic

Simple Question ???

Manohar Karamballi
Ranch Hand

Joined: Jul 17, 2001
Posts: 227
Hai All!
What i am trying is very simple and i am not getting it.

here is my problem:
I have to servlets A & B and i am doing following things.
1) dispatching request from A to B using include method
2) Storing some dummy attribute in a session Object (Using setAttribute) in Servlet B
3) When i tried to retrieve that attribute from A using getAttribute method (After dispatching request) i am getting a null val
Also i donn have any clue whether B is getting invoked or not as
print statements (in B )are also not reflecting.

Any help in this regard is apreciable.

Joined: Jul 24, 2001
Posts: 3
I don't think servlet A can retrieve the attributes set in servlet B.u said the servlet B is included in servlet A ,then the control will go to servlet B,then how can retrieve the attributes set in B.No wonder, u r getting null values.
Manohar Karamballi
Ranch Hand

Joined: Jul 17, 2001
Posts: 227
Thanks for ur reply. But i disagree with what u told. Actually i got through my problem using NamedDispatcher API.
I agree. Here's the link:
subject: Simple Question ???
It's not a secret anymore!