• Post Reply Bookmark Topic Watch Topic
  • New Topic

Accessing Page Context from a servlet

 
JohnWilliam Fitz
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all.

Let's imagine I have a servlet that will dispatch to a jsp page. Ignoring for the moment whether or not it would even make any sense, is it possible for this servlet to stuff an attribute into the PAGE CONTEXT of the dispatched-to jsp? (By page context, I mean that which is represented by the implicit object pageContext within a scriptlet on the jsp page (I know I know, well-behaved web developers never write scriptlets, I know).)

Th�nks in advance,
John
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, page context is for single JSPs only; servlets don't have access to that. The request context would be right for sharing objects in this case.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
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!